[jdom-interest] Well I've been FAQed

Doug Robinson dkr at localhost.telusplanet.net
Sat Nov 2 11:18:05 PST 2002


Hello
	As a newcommer to jdom I am stumbling around through the simplest things.
e.g.I run my test program and get thin message:

 java -jar MyMail.jar
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/jdom/JDOMException
        at MyMail.MyMail.init(MyMail.java:13)
        at MyMail.MyMail.main(MyMail.java:31)

After a long struggle even an old fart like me looks at the manual, in this
case I found & read the FAQ:

I tried to use JDOM and get an error like this:

java.lang.NoSuchMethodError
 or
java.lang.NoClassDefFoundError:
org/xml/sax/SAXNotRecognizedException 

What's wrong?

You need to ensure that the xerces.jar file supplied with the JDOM download is 
in your classpath before any other XML classes, such as those that come with 
JAXP or Crimson. These other XML libraries, as well as older versions of 
Apache Xerces, support DOM Level 1 and SAX 1.0, not the required DOM Level 2 
and SAX 2.0. The result is an exception being thrown. Check your classpath, 
and try again. If the classpath looks OK, the problematic JAR might also be 
hiding in the system's standard extension directory (see the following).

ok then, looks close, i set the classpath on my RH7.3 system thusly:

 export 
CLASSPATH=/home/dkr/Project/jdom-b8/lib/xerces.jar:/home/dkr/Project/jdom-b8/build/jdom.jar

check things out with: ls -l /home/dkr/Project/jdom-b8/lib/xerces.jar
-rw-r--r--    1 dkr      floppy    1812019 Oct 19 17:12   
          /home/dkr/Project/jdom-b8/lib/xerces.jar

and:
 ls -l /home/dkr/Project/jdom-b8/build/jdom.jar
-rw-r--r--    1 dkr      floppy     127026 Oct 19 17:12
          /home/dkr/Project/jdom-b8/build/jdom.jar

now it should run right??

 java -jar MyMail.jar
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/jdom/JDOMException
        at MyMail.MyMail.init(MyMail.java:13)
        at MyMail.MyMail.main(MyMail.java:31)


It seems that this is not the error afterall.

OK then what error is it?

Thanks for your time.
dkr <dkrq at telusplanet.net>

	




More information about the jdom-interest mailing list