[
https://jira.jboss.org/jira/browse/WELDX-38?page=com.atlassian.jira.plugi...
]
Paul Sandoz updated WELDX-38:
-----------------------------
Attachment: jersey-gf-bundle.jar
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/
Unable to deserialize Javassist proxy due to wrong classloader being
used
-------------------------------------------------------------------------
Key: WELDX-38
URL:
https://jira.jboss.org/jira/browse/WELDX-38
Project: Weld Extensions
Issue Type: Bug
Components: Servlet Containers
Affects Versions: Servlet Containers 1.0.0.CR1
Environment: Apache Tomcat 6.0.20
Reporter: Fabio Wang
Fix For: Servlet Containers 1.0.0.CR3
Attachments: Action.java, action.xhtml, Bean.java, jersey-gf-bundle.jar,
template.xhtml
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).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira