Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problems with Xerces (JAXP) and Webstart compatibility?

843802Mar 18 2002 — edited Apr 2 2003

Can anybody offer advice on getting our working xml schema validation code to run under webstart. Basically because the current JAXP and j2se 1.4 offering don't yet handle schema I'm using the xerces parser (2.0.1) to accomplish this, and it all works well from the command line, my problems started when I tried to run from webstart.

Firstly the xml parsers supplied by j2se 1.4.0 seem to override the xerces ones, I can override this by setting the javax.xml.parsers.SAXParserFactory property to point to the xerces parser factory class (org.apache.xerces.jaxp.SAXParserFactoryImpl). But on execution of webstart the code throws:

"javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found"

..Which I assume is due to the webstart classloader not being willing/able to load aforementioned SAXParserFactoryImpl from the xerecesImpl.jar.. again this is odd as it works from the command line without problems.

I've tried modifying our code to explicitly create the parserfactory to be the xerces one (rather than via the JAXP properties) so I call SaxParser saxParserFactory = new org.apache.xerces.jaxp.SAXParserFactoryImpl(); As I can't start changing the xerces code to use the applications classloader. This doesn't work either as webstart now throws:

"org.apache.xerces.parsers.StandardParserConfiguration not found
org.apache.xerces.util.ObjectFactory$ConfigurationError: Provider org.apache.xerces.parsers.StandardParserConfiguration not found"

So I assume internally xerces is doing more classloading that's incompatible with webstart, in general it seems JaxP forces the hand of parsers to load the actual parser implementations dynamically.. but this seems mostly incompatible with the operation of webstarts secure classloader.. problems, problems.

This is a major, major problem for us.. we need a schema validating sax parser that will work with webstart, do I need a more classloading friendly parser than xerces? (is they're one?) . I'm working with j2se 1.3.1 & 1.4.0 under Windows NT4, but we all know that shouldn't matter.. right?

Anyone got a clean solution to these problems? I find it hard to believe all the problems I'm having just delivering a simple java client to validate and parse a simple xml file.

BTW: Installing xerces jars into the lib/ext directories for each client is a non-starter, it has to be compatible with the normal webstart operation.. I know it works for internal testing purposes but I can't expect clients have to do this.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 30 2003
Added on Mar 18 2002
10 comments
1,330 views