Skip to Main Content

Java Programming

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.

JAXB 2.1 API loaded from the bootstrap classloader, but it needs 2.2 API

sljavaApr 26 2012 — edited Apr 26 2012
I am trying to deploy a Java web service into a Tomcat 5.5.20 server. I have the web service packaged in a .war file in Tomcat's webapps directory, and I can see that the .war file gets extracted when I start Tomcat.

However, I get the following error when I start Tomcat:

Apr 22, 2012 5:16:31 AM com.sun.xml.ws.transport.http.servlet.WSServletContextLstener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
Apr 22, 2012 5:16:31 AM com.sun.xml.ws.transport.http.servlet.WSServletContextLstener parseAdaptersAndCreateDelegate
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
java.lang.LinkageError: JAXB 2.1 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.2 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.6.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:178)

In the /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib directory is where all the jar files from JAX-WS 2.2.6 are, including jaxb-api.jar.

I already added "-Djava.endorsed.dirs=/home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib" to the command that starts the WebNMS process that starts Tomcat, but that didn't help.

Also, I tried adding a symbolic link called "endorsed" in the /home/username/WebNMS/jre/lib directory that points to /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib, and that didn't help either.

One interesting thing is that when I do a "find /home/username/WebNMS -name jaxb-api.jar", it only finds the one jaxb-api.jar in the /home/username/WebNMS/apache/tomcat/webapps/WebServices/WEB-INF/lib directory. There are no other jaxb-api.jar files. So I don't know why the error is saying that the JAXB 2.1 API is being loaded, when there's only the JAXB 2.2.6 API jar file. Unless it's finding something outside the /home/username/WebNMS dir, but that shouldn't happen considering I tried 2 different ways to set up the endorsed dir.

Edited by: sljava on Apr 26, 2012 4:10 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2012
Added on Apr 26 2012
0 comments
1,556 views