Weld Exception when deploying to Wildfly 8.1.0
julie_yaoy Feb 4, 2016 9:05 PMI added jclouds artifacts to my app and now I am unable to deploy my app to wildfly 8.1.0 because of weld exception caused by jclouds.
I guess upgrade wildfly to 8.2.0 will probably solve the problem. But it is not an option for the moment.
I can't disable weld globally because it is used in our third party library.
I tried to get earlier version of jclouds1.7.1 and add beans.xml to exclude jclouds. But deployment to wildfly still failed.
I followed doc on:
weld version 2.1.2
build.gradle
compile ("org.apache.jclouds:jclouds-blobstore:1.7.1")
compile ("org.apache.jclouds.driver:jclouds-slf4j:1.7.1")
compile ("org.apache.jclouds.driver:jclouds-okhttp:1.7.1")
compile ("org.apache.jclouds.driver:jclouds-apachehc:1.7.1")
compile ("org.apache.jclouds.provider:aws-s3:1.7.1")
WEB_INF/beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="annotated">
<scan>
<exclude name="org.jclouds.**">
</exclude>
</scan>
</beans>
stacktrace:
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000071: Managed bean class org.jclouds.s3.blobstore.S3BlobRequestSigner must be @Dependent
at org.jboss.weld.bean.ManagedBean.checkType(ManagedBean.java:198)
at org.jboss.weld.bean.AbstractBean.initializeAfterBeanDiscovery(AbstractBean.java:103)
at org.jboss.weld.bean.ManagedBean.initializeAfterBeanDiscovery(ManagedBean.java:113)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:129)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:120)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea]
... 3 more