Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-14115

[GSS](7.0.z) Bean discovery in deployment dependencies (modules) is always interpreted as "all" and fails to inject from static module's exported dependency

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Critical
    • None
    • 7.1.0.GA, 7.0.z.GA
    • None
    • None
    • +
    • Hide

      Have the application depend on module1 which contains the actual jar as a workaround

      Show
      Have the application depend on module1 which contains the actual jar as a workaround

    Description

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

      <jboss-deployment-structure> 
         <deployment>
          <dependencies>
            <module name="module2" meta-inf="export" annotations="true" />
          </dependencies>    
          </deployment>    
      </jboss-deployment-structure>
      

      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">
        <dependencies>
          <module name="module1" export="true">
            <imports>
              <include path="META-INF**"/>
              <include path="org**"/>
            </imports>
            <exports>
              <include path="META-INF**"/>
              <include path="org**"/>
            </exports>
          </module>
        </dependencies>
      </module>
      

      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">
        <resources>
          <resource-root path="cdi-beans.jar"/>
        </resources>
        <dependencies>
          <module name="javax.faces.api" export="true"/>
          <module name="javax.ejb.api"/>
          <module name="javax.enterprise.api"/>
        </dependencies>
      </module>
      

      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.

      Attachments

        1. CDIPruebaMaven.war.zip
          10 kB
        2. org.zip
          10 kB
        3. server.log
          21 kB
        4. sources.zip
          95 kB
        5. test-overlay-eap64.zip
          11 kB
        6. test-overlay-eap71.zip
          11 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: