Jump to content
Excelsior Forums
fdimeglio

org.jdom.JDOMException: Could not load default SAX

Recommended Posts

Hi,

I have been using JET3.5 Personal Edition on my Java application.

This app is using several jar library like JDOM.

When parsing an XML doc I have the following error:

5922 [Thread-1] FATAL xof  - Unable to open game file: D:\src\othbase.net\othbase\data\kurnik.xml

org.jdom.JDOMException: Could not load default SAX parser: org.apache.xerces.parsers.SAXParser: SAX2 driver class org.ap

ache.xerces.parsers.SAXParser not found: org.apache.xerces.parsers.SAXParser

Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

For info this work perfectly with pure Java code. I am using JDOM with no special configuration.

I need probably to include the XML parser into the libs used my JET.

Any idea ?

Fabrice DI MEGLIO

Share this post


Link to post
Share on other sites

You may need to include xerces.jar to be compiled with your application. In JET Control Panel, on page Classes include the jar into classpath and force it to compilation.

Share this post


Link to post
Share on other sites

Thank you very much.

I have well understood and now it seems to works correectly.

I am using now Xerces and I have included its jar into the libraries to be compiled and used the following VM parameters:

-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

But there us still 2 strange points:

First, my code was previously using the default JRE XML parser (Crimson) and was working perfectly and speedy as Java Bytecode.

Why, when I use Excelsior JET, the default XML perser is now forced to Xerces ? It seems like a big limitation as it forces people to include a quite big library.

FYI, I have tried also to setup the default parser to Crisom via the corresponding VM parameters:

-Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl

but it does not work.

Second, parsing big XML files with Xerces is now very very slow under JET compared to the Java bytecode with Xerces.

Any idea for those two points?

Fabrice

Share this post


Link to post
Share on other sites

1) All jetvm properties syntax is through colon, but not through equality sign. I.e., correct versions are

-Djavax.xml.parsers.SAXParserFactory:org.apache.xerces.jaxp.SAXParserFactoryImpl

and

-Djavax.xml.parsers.SAXParserFactory:org.apache.crimson.jaxp.SAXParserFactoryImpl  

2) If the slowdown problem is still unresolved, please send your project to our Support Dept. at java@excelsior-usa.com.

Share this post


Link to post
Share on other sites

×