aspose file tools*
The moose likes XML and Related Technologies and the fly likes Getting JAXB to work in J2EE project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Getting JAXB to work in J2EE project" Watch "Getting JAXB to work in J2EE project" New topic
Author

Getting JAXB to work in J2EE project

Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
I managed to get JAXB to work as regular java application. However, I can't get it to work in my J2EE application.

I'm currently getting the following exception:-
java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.getSchema()Ljavax/xml/validation/Schema

By reading this site, http://forum.java.sun.com/thread.jspa?threadID=642441&messageID=3787464 , it seems like it is loading older Xerces.class, and omitting the newer class in jaxb jars sitting in my /WEB-INF/lib.

To get my java app to work, I have to invoke the java launcher with -Djava.endorsed.dirs= option, so that it picks up the new class.

But, how do I solve the class loader issue with a J2EE project?

I know I could solve this problem by switching to jdk 1.5, but my project is deployed in WAS 6 which uses jdk 1.4.

Any tips would be grateful here.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting JAXB to work in J2EE project