Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution:
Out of Date
-
Affects Version/s: None
-
Fix Version/s: TBC
-
Component/s: Servlet Container Support
-
Labels:None
-
Environment:Apache Tomcat 6.0.20
-
Forum Reference:
Description
Trying to mark a conversation as long-running causes an exception (java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject) when the ServletConversationManager tries to get a proxy for the httpSession.
The ProxyFactory.classLoaderProvider ends up resolving the classloader to an instance of org.apache.catalina.loader.StandardClassLoader (which doesn't know the javassist lib, since it's only in the app classloader).
Gliffy Diagrams
-
- Action.java
- 0.9 kB
- Fabio Wang
-
- action.xhtml
- 0.8 kB
- Fabio Wang
-
- Bean.java
- 0.3 kB
- Fabio Wang
-
Hide
- jersey-gf-bundle.jar
- 1.05 MB
- Paul Sandoz
-
- META-INF/MANIFEST.MF 25 kB
- META-INF/maven/.../pom.properties 0.2 kB
- META-INF/maven/.../jersey-gf-bundle/pom.xml 7 kB
- META-INF/.../com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider 0.4 kB
- META-INF/.../com.sun.jersey.spi.HeaderDelegateProvider 0.5 kB
- META-INF/.../com.sun.jersey.spi.StringReaderProvider 0.5 kB
- META-INF/.../com.sun.jersey.spi.container.ContainerProvider 0.1 kB
- META-INF/.../com.sun.jersey.spi.container.ContainerRequestFilter 0.1 kB
- META-INF/.../com.sun.jersey.spi.container.ContainerResponseFilter 0.0 kB
- META-INF/.../com.sun.jersey.spi.container.WebApplicationProvider 0.1 kB
- META-INF/.../com.sun.jersey.spi.inject.InjectableProvider 0.3 kB
- META-INF/.../javax.enterprise.inject.spi.Extension 0.1 kB
- META-INF/.../javax.servlet.ServletContainerInitializer 0.1 kB
- META-INF/.../javax.ws.rs.ext.MessageBodyReader 3 kB
- META-INF/.../javax.ws.rs.ext.MessageBodyWriter 2 kB
- META-INF/.../javax.ws.rs.ext.RuntimeDelegate 0.1 kB
- com/sun/.../api/ConflictException.class 1 kB
- com/sun/.../api/NotFoundException.class 1 kB
- com/.../ParamException$CookieParamException.class 0.7 kB
- com/.../ParamException$FormParamException.class 0.7 kB
- com/.../ParamException$HeaderParamException.class 0.7 kB
- com/.../ParamException$MatrixParamException.class 0.8 kB
- com/.../ParamException$PathParamException.class 0.8 kB
- com/.../ParamException$QueryParamException.class 0.8 kB
- com/.../ParamException$URIParamException.class 0.9 kB
- com/sun/jersey/api/ParamException.class 2 kB
- com/sun/jersey/api/Responses.class 1 kB
- com/.../AbstractClientRequestAdapter.class 0.7 kB
- com/sun/.../AsyncUniformInterface.class 4 kB
- com/sun/.../client/AsyncWebResource$1.class 2 kB
-
- template.xhtml
- 0.8 kB
- Fabio Wang
Issue Links
Activity
- All
- Comments
- Work Log
- History
- Activity
- Links Hierarchy
I might have just hit this bug (or a very similar one?): Read http://www.seamframework.org/Community/HowToReachHttpServletRequestAndHttpServletResponseFromBean
Francisco please create a new issue, explain step by step how to reproduce and attach relevant sources, and link to this as related.
As this is working with a manual test, and I can't write a test with embedded TC (which is all Arquillian supports right now), I'm descheduling.
To be clear this issue has been fixed, the issue is simply open to remind us to add a test when we can.
I am observing a similar exception when attempting to use Weld integrated into GlassFish. I am not sure if the cause is exactly the same but it still might be useful information.
Glassfish's JAX-RS implementation, Jersey, needs to use a 299 Extension implementation such that the InjectionTarget of ProcessInjectTarget events can be adapted thus enabling JAX-RS artifacts to be injected.
If you copy the attached jersey-gf-bundle.jar into current nightly build of GF [1] to the location:
glassfish/modules/jersey-gf-bundle.jar
start GlassFish then deploy a simple 299 enabled web app you should see the following exception in the server.log when it attempts to create a client proxy to the Extension class:
WARNING: Exception while dispatching an event
org.jboss.weld.DefinitionException: org.jboss.weld.DefinitionException: java.lang.RuntimeException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:43)
at org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.fire(BeforeBeanDiscoveryImpl.java:40)
at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:270)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:135)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:88)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:228)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:314)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:169)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1159)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1218)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1207)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:362)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:201)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:241)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:789)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:697)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:951)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:166)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.FixedThreadPool$BasicWorker.doWork(FixedThreadPool.java:431)
at com.sun.grizzly.util.FixedThreadPool$BasicWorker.run(FixedThreadPool.java:410)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.jboss.weld.DefinitionException: java.lang.RuntimeException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:51)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:39)
... 33 more
Caused by: java.lang.RuntimeException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:344)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:314)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:273)
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:84)
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$000(ClientProxyProvider.java:41)
at org.jboss.weld.bean.proxy.ClientProxyProvider$1.call(ClientProxyProvider.java:122)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.jboss.weld.util.collections.ConcurrentCache.putIfAbsent(ConcurrentCache.java:125)
at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:112)
at org.jboss.weld.BeanManagerImpl.getReference(BeanManagerImpl.java:890)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:215)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:196)
at org.jboss.weld.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:844)
at org.jboss.weld.BeanManagerImpl.fireEvent(BeanManagerImpl.java:837)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:47)
... 34 more
Caused by: javassist.CannotCompileException: by java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:169)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:339)
... 49 more
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/ProxyObject
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:703)
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 javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:181)
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:163)
... 50 more
Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.ProxyObject
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:738)
at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:60)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1650)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
... 58 more
A workaround is to add the following to the Import-Package header of the MANIFEST.MF:
javassist.util.proxy;resolution:=optional;version="3.8"
Note that this error only occurs for the Extension implementation class in the jersey-gf-bundle.jar and does not occur for other 299 managed beans declared in a web app.
Such a declaration should not be required as there is no direct dependency on that package. It is not clear to me if this is a class loading issue with Weld or a class loading issue with GlassFish's OSGi container, or a combination of both.
Unfortunately i cannot create a more isolated test case.
[1] http://download.java.net/glassfish/v3/nightly/