Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9846

Unsatisfied dependencies for CDI Beans in static module's dependency



      WAR CDI bean is failing to inject a CDI bean from a static module's exported dependency. war -> static module X -> static module Y (containing CDI Beans)

      A WAR uses a static module with the slot attribute. This static module is referenced in jboss-deployment-structure.xml:

            <module name="module2" meta-inf="export" annotations="true" />

      module2 which the app depends on is depending on module1 and including/exporting META-INF where the beans.xml is located:

      <?xml version="1.0"?>
      <module xmlns="urn:jboss:module:1.5" name="module2">
          <module name="module1" export="true">
              <include path="META-INF**"/>
              <include path="org**"/>
              <include path="META-INF**"/>
              <include path="org**"/>

      module1 contains the jar with the CDI beans and has a META-INF/beans.xml in it:

      <?xml version="1.0" encoding="UTF-8"?>
      <module xmlns="urn:jboss:module:1.5" name="module1">
          <resource-root path="cdi-beans.jar"/>
          <module name="javax.faces.api" export="true"/>
          <module name="javax.ejb.api"/>
          <module name="javax.enterprise.api"/>

      The deploy fails with the next message:

      14:04:07,085 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."test.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".WeldStartService: Failed to start service
      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type ExampleCdiBean with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private backingbeans.BackingBean.cdiBean
        at backingbeans.BackingBean.cdiBean(BackingBean.java:0)

      In JBoss EAP 6.4, this scenario, the CDI is working fine.

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  manovotn Matěj Novotný
                  bmaxwell Brad Maxwell
                • Votes:
                  0 Vote for this issue
                  4 Start watching this issue


                  • Created: