1 Reply Latest reply on Feb 8, 2016 3:14 AM by Martin Kouba

    Weld Exception when deploying to Wildfly 8.1.0

    Newbie

      I 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: Documentation

      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

        • 1. Re: Weld Exception when deploying to Wildfly 8.1.0
          Martin Kouba Master

          Hi Julie,

          where exactly did you put the beans.xml file? In order to make it work you would have to place the file in the jclouds jar (for a jar it should be META-INF/beans.xml) included in your application. Also have you tried the require-bean-descriptor config property described in the FAQ (it's a workaround to configure WildFly to require the beans.xml file in bean archives - suppress implicit bean archives)?