billbaloney
House pianist
My eyes are blurry; that must mean I have a java classpath issue again.
I have an executable jar that involves, among other things, instantiating an XML reader:
XMLReader parser = org.xml.sax.helpers.XMLReaderFactory.createXMLReader( "org.apache.xerces.parsers.SAXParser" );
The parser, org.apache.xerces.parsers.SAXParser, is in xercesImpl.jar.
If I run this jar from the command line, e.g.,
java -jar thisjar.jar
I get a ClassNotFoundException:
Exception: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
java.lang.NullPointerException
Right. So then I include all of the xerces jars on the classpath:
java -cp xercesImpl.jar:xml-apis.jar:xmlParserAPIs.jar thisjar.jar
and I still get the ClassNotFoundException. Any ideas?
I can replicate this on different OSes too, which makes me suspicious that I'm doing something stupid. Which is what always, always happens when I start wrestling with java's labyrinthine world of classpaths.
TIA.
I have an executable jar that involves, among other things, instantiating an XML reader:
XMLReader parser = org.xml.sax.helpers.XMLReaderFactory.createXMLReader( "org.apache.xerces.parsers.SAXParser" );
The parser, org.apache.xerces.parsers.SAXParser, is in xercesImpl.jar.
If I run this jar from the command line, e.g.,
java -jar thisjar.jar
I get a ClassNotFoundException:
Exception: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
java.lang.NullPointerException
Right. So then I include all of the xerces jars on the classpath:
java -cp xercesImpl.jar:xml-apis.jar:xmlParserAPIs.jar thisjar.jar
and I still get the ClassNotFoundException. Any ideas?
I can replicate this on different OSes too, which makes me suspicious that I'm doing something stupid. Which is what always, always happens when I start wrestling with java's labyrinthine world of classpaths.
TIA.