users@jersey.java.net

Re: [Jersey] LinkageError: JAXB 2.0 API running Jersey Tests as part of a Maven build on Hudson

From: Srinivas Naresh Bhimisetty <shri.naresh_at_gmail.com>
Date: Fri, 14 May 2010 16:39:58 +0530

Steve,

  which Java version (in your Hudson environment) are you using? I have had
a similar issue with Java 5 earlier, later when I tried with JDK 1.6.0_14
it worked fine. Can you verify that the version of JDK that you have on your
local setup is the same as that in your Hudson environment?


Note:
  We have seen few issues with the Maven versions higher than 2.0.9 while
using JerseyTestFramework. These versions of Maven for some reason do not
set the properties that you set using the "-D" command line parameter.
Though your issue is not related to this, I thought it would be good to let
you know, so that you do not get into this problem sometime in the future.

- Naresh

On Tue, May 11, 2010 at 9:26 PM, schong <dr.steve.chong_at_gmail.com> wrote:

>
> Hello,
> Apologies if this is posted in the wrong place - I'm not sure if it is
> related to Jersey, Maven or Hudson.
>
> Hudson is building my project using Maven 2.2.1 and JDK 1.6. As part of the
> build it executes my JerseyTests (this project uses 1.0.3 of the Jersey
> Test
> Framework).
>
> When Hudson does the build I get the errors below.
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running org.xxxxxxxxxxxx.address.service.AddressTest
> 11-May-2010 11:23:30
>
> com.sun.jersey.test.framework.impl.container.grizzly.web.GrizzlyWebContainer
> start
> INFO: Starting grizzly...
> 11-May-2010 11:23:30 com.sun.grizzly.http.servlet.ServletContextImpl
> initListeners
> WARNING: Unable to load listener: null
> 11-May-2010 11:23:31 com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Scanning for root resource and provider classes in the packages:
> org.xxxxxxxxxxxx.address.service
> 11-May-2010 11:23:31 com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Root resource classes found:
> class org.xxxxxxxxxxxx.address.service.AddressService
> 11-May-2010 11:23:31 com.sun.jersey.api.core.PackagesResourceConfig init
> INFO: Provider classes found:
> 11-May-2010 11:23:32 com.sun.grizzly.http.servlet.ServletAdapter service
> SEVERE: service exception:
> java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap
> classloader, but this RI (from
>
> jar:file:/root/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1/jaxb-impl-2.1.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class)
> 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/)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:135)
> at
>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
> at
>
> com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:253)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:84)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:66)
> at
> com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:132)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 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:132)
> at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
> at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
> at
>
> com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:66)
> at
> com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:93)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.initWadl(WebApplicationImpl.java:827)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:753)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:590)
> at
>
> com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:383)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:377)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:242)
> at
>
> com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:449)
> at
>
> com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:169)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:281)
> at
>
> com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:442)
> at javax.servlet.GenericServlet.init(GenericServlet.java:241)
> at
>
> com.sun.grizzly.http.servlet.ServletAdapter.loadServlet(ServletAdapter.java:327)
> at
>
> com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:268)
> at
> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:726)
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:615)
> at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:895)
> at
>
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:162)
> at
>
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
> at
>
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
> at
>
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
> at
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
>
>
> The Netbeans Maven build executes the tests fine and running the build from
> the command prompt (mvn clean install) also executes the tests fine.
>
> The Hudson server's local repo contains the following jaxb related files:
>
> jaxb-impl
> ./com/sun/xml/bind/jaxb-impl:
> ./com/sun/xml/bind/jaxb-impl/2.1:
> jaxb-impl-2.1.jar
> jaxb-impl-2.1.jar.md5
> jaxb-impl-2.1.pom
> jaxb-impl-2.1.pom.md5
> ./com/sun/xml/bind/jaxb-impl/2.1.10:
> jaxb-impl-2.1.10.pom
> jaxb-impl-2.1.10.pom.md5
> ./com/sun/xml/bind/jaxb-impl/2.1.12:
> jaxb-impl-2.1.12.pom
> jaxb-impl-2.1.12.pom.md5
> jaxb-api
> ./javax/xml/bind/jaxb-api:
> ./javax/xml/bind/jaxb-api/2.1:
> jaxb-api-2.1.jar
> jaxb-api-2.1.jar.md5
> jaxb-api-2.1.pom
> jaxb-api-2.1.pom.md5
>
> I can see the error:
>
> "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/)"
>
> - but I'm not sure which bootstrap classloader this is or if it can be
> configured.
>
> Does anyone have any help or suggestions?
>
> Thanks,
> Steve
>
>
> --
> View this message in context:
> http://jersey.576304.n2.nabble.com/LinkageError-JAXB-2-0-API-running-Jersey-Tests-as-part-of-a-Maven-build-on-Hudson-tp5036755p5036755.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>