Exception in thread "Thread-0"

From: thufir (thufir.hawat_at_mail.com)
Date: 01/23/05


Date: 23 Jan 2005 13:47:23 -0800

What does this error mean, please?

I don't know if it's due to how packages and classpath are being used
with javac and java, or if it's the code itself.

///////////////////command line//////////////////
C:\>
C:\>javac @comp

C:\>java -classpath C:\java\classes\ atreides.jtidy.TidyTest
Exception in thread "Thread-0" java.lang.NoClassDefFoundError:
org/w3c/tidy/Tidy
at atreides.jtidy.TidyTest.run(TidyTest.java:33)
at java.lang.Thread.run(Unknown Source)

C:\>type comp
-d C:\java\classes\
-g
-sourcepath C:\java\sources\
-classpath .;C:\java\classes\;C:\java\classes\org\w3c\tidy\Tidy.jar

C:\java\sources\atreides\jtidy\TidyTest.java

C:\>type C:\java\sources\atreides\jtidy\TidyTest.java
package atreides.jtidy;

import java.io.IOException;
import java.net.URL;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import org.w3c.tidy.Tidy;

public class TidyTest implements Runnable {

private String url;
private String outFileName;
private String errOutFileName;
private boolean xmlOut;

public TidyTest(String url, String outFileName,
String errOutFileName, boolean xmlOut)
{
this.url = url;
this.outFileName = outFileName;
this.errOutFileName = errOutFileName;
this.xmlOut = xmlOut;
}

public void run()
{
URL u;
BufferedInputStream in;
FileOutputStream out;
Tidy tidy = new Tidy();

tidy.setXmlOut(xmlOut);
try {
tidy.setErrout(new PrintWriter(new
FileWriter(errOutFileName),
true));
u = new URL(url);
in = new BufferedInputStream(u.openStream());
out = new FileOutputStream(outFileName);
tidy.parse(in, out);
}
catch ( IOException e ) {
System.out.println( this.toString() + e.toString() );
}
}

public static void main( String[] args ) {

String url = "http://www.google.com/";
String output = "output.txt";
String errorLog = "errorLog.txt";

TidyTest t1 = new TidyTest(url,output,errorLog,true);
Thread th1 = new Thread(t1);
th1.start();
    }

}

C:\>

Thanks,

Thufir Hawat



Relevant Pages

  • Re: Reflection in 1.1 and 2.0 - generic, fast copy delegate?
    ... Your delegate solution is is still significantly more efficient that reflection. ... Also you need permissions to emit code with the LCG version whereas using delegates does not appear to require permissions beyond those for public reflection and so you can have a fast solution even in low trust environments. ... private string _firstName; ...
    (microsoft.public.dotnet.framework.clr)
  • Re: EJB3 Newbie & Persistence
    ... private String name; ... CustomerCMP customer; ... public void setAddress{ ...
    (comp.lang.java.beans)
  • Re: Reflection in 1.1 and 2.0 - generic, fast copy delegate?
    ... private string _firstName; ... private int _age; ... I'm well aware of LCG, and in fact, I'm not even sure why you need it in 2.0. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: variable length fields for flexibility in subroutines
    ... private string _IntBlock; ... public string IBreturn ... public string IBstreet ...
    (comp.lang.cobol)
  • Re: Method.property string
    ... GetData.Col.RowOverload Col to set or get the ... Then would I instantiate the Col class from within the GetData Class to call ... private string name; ... public string GetName() ...
    (microsoft.public.dotnet.framework)