-
Bug
-
Resolution: Done
-
Major
-
3.0.1.Final
-
None
The MANIFEST.MF in weld-osgi-bundle.jar (org.jboss.weld:weld-osgi-bundle:3.0.1.Final) doesn't export the org.jboss.weld.proxy package.
Export of this package is needed for the new WeldConstruct type that was added to the Weld API in 3.0.SP1.
Without this export being available, the following exception will be thrown in an OSGi environment:
org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Built-in Bean [javax.transaction.UserTransaction] with qualifiers [@Default] with class interface javax.transaction.UserTransaction using classloader WebappClassLoader (delegate=true; repositories=WEB-INF/classes/) at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:389) at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:351) at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:343) at org.jboss.weld.bean.builtin.ee.AbstractEEBean.<init>(AbstractEEBean.java:36) at org.jboss.weld.module.jta.UserTransactionBean.<init>(UserTransactionBean.java:52) at org.jboss.weld.module.jta.WeldTransactionsModule.preBeanRegistration(WeldTransactionsModule.java:46) at org.jboss.weld.module.WeldModules.preBeanRegistration(WeldModules.java:158) at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:224) at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:422) at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83) at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:259) ... 66 more Caused by: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/weld/proxy/WeldConstruct at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:101) at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:488) at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:381) ... 76 more Caused by: java.lang.NoClassDefFoundError: org/jboss/weld/proxy/WeldConstruct at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:108) at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:97) ... 78 more Caused by: java.lang.ClassNotFoundException: org.jboss.weld.proxy.WeldConstruct at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1501)
I've manually added the export to the MANIFEST.MF file, and after that the exception is gone and CDI seems to work again.