users@jersey.java.net

Re: [Jersey] Jersey 1.0 on Tomcat 6 with JDK 6 does not run

From: Craig McClanahan <Craig.McClanahan_at_Sun.COM>
Date: Thu, 19 Feb 2009 11:08:47 -0800

sarat.pediredla wrote:
> Hi,
>
> I have a Jersey enabled application that is deployed on Tomcat 6. I have had
> no problems running this in JDK 5 but a recent JDK update to 6 is now
> breaking everything. The error I get is as follows,
>
One potential issue is that, in JDK 1.6, the JAXB libraries are now
bundled. You might try removing them from your webapp to see if that
(removing the duplicated JAXB classes, possibly with a different JAXB
version) makes any difference.

Craig
> <code>
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:432)
> at
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:297)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
> at sun.reflect.GeneratedMethodAccessor246.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
> at
> com.sun.jersey.impl.provider.entity.AbstractJAXBProvider.getStoredJAXBContext(AbstractJAXBProvider.java:194)
> at
> com.sun.jersey.impl.provider.entity.AbstractJAXBProvider.getJAXBContext(AbstractJAXBProvider.java:172)
> at
> com.sun.jersey.impl.provider.entity.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:158)
> at
> com.sun.jersey.impl.provider.entity.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:131)
> at
> com.sun.jersey.impl.provider.entity.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:110)
> at
> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:251)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:752)
> at
> com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> ... 91 more
> </code>
>
> A search on Google reveals nothing except the fact that the Java 6 is
> suspect in some way? Or is this a problem with the JAXB implementation and
> version? Any help appreciated.
>