users@jax-ws.java.net

Classloader issue fix with usage of JAXWS 2.1/JDK 1.6/Tomcat 5.5/Netbeans 5.5

From: Prashant Jamkhedkar <Prashant_Jamkhedkar_at_symantec.com>
Date: Mon, 12 Mar 2007 10:19:09 -0700

 
I tried to use JAXWS 2.1 with JDK 1.6/Tomcat 5.5/Netbeans 5.5

With Netbeans 5.5, I had to build a new library for JAXWS 2.1.
(by using correct JAXWS RI ones)

Its already bundled with Netbeans 5.5.1 (beta).

I tried using bundled as well as unbundled Tomcat server (5.5), with
Netbeans 5.5/5.5.1(beta).

Ran into a classloader issue, when trying to run the web service
deployed on Tomcat, with the following trace :

----------------------------------------------------------------------
SEVERE: WSSERVLET11: failed to parse runtime descriptor:
java.lang.LinkageError: JAXB 2.0 API is
being loaded from the bootstrap classloader, but this RI
(from
jar:file:/C:/projects/netbeans/Calculator21TCWebApplication/build/web/WE
B-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.cla
ss)
needs 2.1 API. Use the endorsed directory mechanism to place
jaxb-api.jar in the bootstrap classloader.
(See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap
classloader, but this RI (from
jar:file:/C:/projects/netbeans/Calculator21TCWebApplication/build/web/WE
B-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.cla
ss) needs 2.1 API. Use the endorsed directory mechanism to place
jaxb-api.jar in the bootstrap classloader. (See
http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
.....
------------------------------------------------------------------------
------

Resolved the classloader issue by adding the jaxb-api.jar under
Tomcat5.5\common\endorsed
The key is to enable it in the setclasspath.bat script.
(as this feature in Tomcat was thought to be in use for JDK 1.4 (to
resolve the xerces loading issue) and not used for any other verion
other than 1.4. This will enable the classloader to load classes
(JAXWS 2.1) before the default bundled ones with JDK 1.6.


Thanks,
Prashant