[jdom-interest] no parser on classpath but things work... I can't explain this... can you?

Fred Tucci ftucci at home.com
Thu Jul 26 07:35:26 PDT 2001

I hope this won't be too embarrassing but it's been bothering me for
some time and I can't figure it out. The story goes like this: 

code snippet:

import org.xml.sax.XMLReader;
import org.apache.xerces.parsers.SAXParser;
XMLReader parser = new SAXParser();

if jdom.jar is on the classpath this work fine (no other parser in the
classpath or EXT dirs, in fact the only thing on the classpath is
jdom.jar and my class)

if I take jdom.jar off the classpath I get
java.lang.NoClassDefFoundError: org/apache/xerces/parsers/SAXParser 

if I then put xerces on the classpath all works fine (this is expected)

what I can't figure out is why does this work when jdom.jar is the only
jar on the classpath? I'm certain that I'm not picking up any other
parser 'cause when I take jdom off things fail.  I checked the jdom.jar
and can't see any parser packages in there... so what magic is JDOM
doing to make this work? 

Thanks, FredT

More information about the jdom-interest mailing list