users@jersey.java.net

Re: [Jersey] ContainerException on Websphere 7

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 16 Jul 2009 16:53:50 +0200

Hi,

The source of the problem is a java.lang.VerifyError for the
JAXBElement class, when creating the WADL resource that has a
dependency on JAXB.

It might be because there two classes of JAXBElement in the class path
(e.g. include two JAXB jars or maybe another jar that bundles JAXB),
but it is not obvious why such an error occurs, for example see here:

   http://stackoverflow.com/questions/100107/reasons-of-getting-a-java-lang-verifyerror

Maybe the following helps:

   http://forums.java.net/jive/message.jspa?messageID=193093

I really no next to nothing about WebSphere so all i can suggest is
you ask on some Websphere related forums.

Paul.

On Jul 16, 2009, at 4:31 PM, karim Daher wrote:

> Hi
> I created an application with jersey project and test on Weblogic
> without any issues. However when I wanted to deploy it on Websphere
> 7, I loaded the resource classes, and just after this it throws the
> following exception:
> com.sun.jersey.api.container.ContainerException: Unable to create
> resource
> at com.sun.jersey.server.impl.resource.SingletonFactory
> $Singleton.init(SingletonFactory.java:131)
>
> I am using jersey 1.0.3 and IBM Websphere 7. Thank you for any idea
> that you think could help me.
>
> This is the whole trace I got:
>
> [7/15/09 15:43:09:444 EDT] 0000000a PackagesResou I Provider
> classes found:
> [7/15/09 15:43:12:147 EDT] 0000000a FfdcProvider I
> com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC
> Incident emitted on C:\WebSphere\AppServer\profiles\AppSrv01\logs
> \ffdc\server1_49b049b_09.07.15_15.43.11.99147062.txt
> com.ibm.ws.webcontainer.servlet.ServletInstance.init 181
> [7/15/09 15:43:12:194 EDT] 0000000a servlet E
> com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E:
> Uncaught init() exception created by servlet Proxy services in
> application ApproveItEVaultManager:
> com.sun.jersey.api.container.ContainerException: Unable to create
> resource
> at com.sun.jersey.server.impl.resource.SingletonFactory
> $Singleton.init(SingletonFactory.java:131)
> at
> com
> .sun.jersey.server.impl.model.ResourceClass.init(ResourceClass.java:
> 200)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.getResourceClass(WebApplicationImpl.java:315)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.initWadlResource(WebApplicationImpl.java:844)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.processRootResources(WebApplicationImpl.java:815)
> 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
> .ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:
> 325)
> at
> com
> .ibm
> .ws
> .webcontainer
> .servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:165)
> at
> com
> .ibm
> .ws
> .webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:
> 1588)
> at
> com
> .ibm
> .wsspi
> .webcontainer
> .extension
> .WebExtensionProcessor
> .createServletWrapper(WebExtensionProcessor.java:98)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:
> 936)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:
> 857)
> at
> com
> .ibm
> .ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:
> 538)
> at
> com
> .ibm
> .ws
> .webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:
> 360)
> at
> com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:
> 292)
> at
> com
> .ibm
> .ws
> .webcontainer
> .webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)
> at
> com
> .ibm
> .ws
> .webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:
> 167)
> at
> com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:
> 722)
> at
> com
> .ibm
> .ws
> .webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:
> 607)
> at
> com
> .ibm
> .ws
> .webcontainer
> .component.WebContainerImpl.install(WebContainerImpl.java:376)
> at
> com
> .ibm
> .ws
> .webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:
> 668)
> at
> com
> .ibm
> .ws
> .runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:
> 1162)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .DeployedApplicationImpl
> .fireDeployedObjectStart(DeployedApplicationImpl.java:1313)
> at
> com
> .ibm
> .ws
> .runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:
> 611)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
> at
> com
> .ibm
> .ws
> .runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:
> 2092)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:
> 437)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:
> 380)
> at
> com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access
> $300(CompositionUnitMgrImpl.java:105)
> at com.ibm.ws.runtime.component.CompositionUnitMgrImpl
> $CUInitializer.run(CompositionUnitMgrImpl.java:928)
> at com.ibm.wsspi.runtime.component.WsComponentImpl
> $_AsynchInitializer.run(WsComponentImpl.java:349)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:
> 1527)
> Caused by: java.lang.reflect.InvocationTargetException
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun
> .reflect
> .NativeConstructorAccessorImpl
> .newInstance(NativeConstructorAccessorImpl.java:45)
> at
> sun
> .reflect
> .DelegatingConstructorAccessorImpl
> .newInstance(DelegatingConstructorAccessorImpl.java:39)
> at
> java.lang.reflect.Constructor.newInstance(Constructor.java:515)
> at
> com
> .sun
> .jersey
> .server
> .spi
> .component
> .ResourceComponentConstructor
> ._construct(ResourceComponentConstructor.java:173)
> at
> com
> .sun
> .jersey
> .server
> .spi
> .component
> .ResourceComponentConstructor
> .construct(ResourceComponentConstructor.java:155)
> at com.sun.jersey.server.impl.resource.SingletonFactory
> $Singleton.init(SingletonFactory.java:129)
> ... 41 more
> Caused by: java.lang.VerifyError: javax/xml/bind/
> JAXBElement.<init>(Ljavax/xml/namespace/QName;Ljava/lang/Class;Ljava/
> lang/Object;)V
> at
> com
> .sun
> .jersey
> .server.wadl.WadlGeneratorImpl.createResponse(WadlGeneratorImpl.java:
> 176)
> at
> com
> .sun
> .jersey.server.wadl.WadlBuilder.generateResponse(WadlBuilder.java:351)
> at
> com
> .sun.jersey.server.wadl.WadlBuilder.generateMethod(WadlBuilder.java:
> 161)
> at
> com
> .sun
> .jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:266)
> at
> com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:102)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .wadl
> .WadlApplicationContextImpl
> .getApplication(WadlApplicationContextImpl.java:73)
> at
> com
> .sun.jersey.server.impl.wadl.WadlResource.<init>(WadlResource.java:73)
> ... 48 more
>
> [7/15/09 15:43:12:209 EDT] 0000000a extension E
> com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor
> createServletWrapper Error occured while preparing the servlet for
> initialization.
> javax.servlet.ServletException:
> SRVE0207E: Uncaught initialization exception created by servlet
> at
> com
> .ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:
> 377)
> at
> com
> .ibm
> .ws
> .webcontainer
> .servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:165)
> at
> com
> .ibm
> .ws
> .webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:
> 1588)
> at
> com
> .ibm
> .wsspi
> .webcontainer
> .extension
> .WebExtensionProcessor
> .createServletWrapper(WebExtensionProcessor.java:98)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:
> 936)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:
> 857)
> at
> com
> .ibm
> .ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:
> 538)
> at
> com
> .ibm
> .ws
> .webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:
> 360)
> at
> com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:
> 292)
> at
> com
> .ibm
> .ws
> .webcontainer
> .webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:99)
> at
> com
> .ibm
> .ws
> .webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:
> 167)
> at
> com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:
> 722)
> at
> com
> .ibm
> .ws
> .webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:
> 607)
> at
> com
> .ibm
> .ws
> .webcontainer
> .component.WebContainerImpl.install(WebContainerImpl.java:376)
> at
> com
> .ibm
> .ws
> .webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:
> 668)
> at
> com
> .ibm
> .ws
> .runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:
> 1162)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .DeployedApplicationImpl
> .fireDeployedObjectStart(DeployedApplicationImpl.java:1313)
> at
> com
> .ibm
> .ws
> .runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:
> 611)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)
> at
> com
> .ibm
> .ws
> .runtime
> .component
> .ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
> at
> com
> .ibm
> .ws
> .runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:
> 2092)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:
> 437)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)
> at
> com
> .ibm
> .ws
> .runtime
> .component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:
> 380)
> at
> com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access
> $300(CompositionUnitMgrImpl.java:105)
> at com.ibm.ws.runtime.component.CompositionUnitMgrImpl
> $CUInitializer.run(CompositionUnitMgrImpl.java:928)
> at com.ibm.wsspi.runtime.component.WsComponentImpl
> $_AsynchInitializer.run(WsComponentImpl.java:349)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:
> 1527)
> Caused by: com.sun.jersey.api.container.ContainerException: Unable
> to create resource
> at com.sun.jersey.server.impl.resource.SingletonFactory
> $Singleton.init(SingletonFactory.java:131)
> at
> com
> .sun.jersey.server.impl.model.ResourceClass.init(ResourceClass.java:
> 200)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.getResourceClass(WebApplicationImpl.java:315)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.initWadlResource(WebApplicationImpl.java:844)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .application
> .WebApplicationImpl.processRootResources(WebApplicationImpl.java:815)
> 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
> .ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:
> 325)
> ... 27 more
> Caused by: java.lang.reflect.InvocationTargetException
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun
> .reflect
> .NativeConstructorAccessorImpl
> .newInstance(NativeConstructorAccessorImpl.java:45)
> at
> sun
> .reflect
> .DelegatingConstructorAccessorImpl
> .newInstance(DelegatingConstructorAccessorImpl.java:39)
> at
> java.lang.reflect.Constructor.newInstance(Constructor.java:515)
> at
> com
> .sun
> .jersey
> .server
> .spi
> .component
> .ResourceComponentConstructor
> ._construct(ResourceComponentConstructor.java:173)
> at
> com
> .sun
> .jersey
> .server
> .spi
> .component
> .ResourceComponentConstructor
> .construct(ResourceComponentConstructor.java:155)
> at com.sun.jersey.server.impl.resource.SingletonFactory
> $Singleton.init(SingletonFactory.java:129)
> ... 41 more
> Caused by: java.lang.VerifyError: javax/xml/bind/
> JAXBElement.<init>(Ljavax/xml/namespace/QName;Ljava/lang/Class;Ljava/
> lang/Object;)V
> at
> com
> .sun
> .jersey
> .server.wadl.WadlGeneratorImpl.createResponse(WadlGeneratorImpl.java:
> 176)
> at
> com
> .sun
> .jersey.server.wadl.WadlBuilder.generateResponse(WadlBuilder.java:351)
> at
> com
> .sun.jersey.server.wadl.WadlBuilder.generateMethod(WadlBuilder.java:
> 161)
> at
> com
> .sun
> .jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:266)
> at
> com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:102)
> at
> com
> .sun
> .jersey
> .server
> .impl
> .wadl
> .WadlApplicationContextImpl
> .getApplication(WadlApplicationContextImpl.java:73)
> at
> com
> .sun.jersey.server.impl.wadl.WadlResource.<init>(WadlResource.java:73)
> ... 48 more
>
>
> Avec Windows Live, vous gardez le contact avec tous vos amis au même
> endroit.