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

[GSS](7.1.2 patch) Bean discovery in deployment dependencies (modules) fails to inject from static module-alias's exported dependency

XMLWordPrintable

    • Icon: Support Patch Support Patch
    • Resolution: Obsolete
    • Icon: Critical Critical
    • None
    • 7.0.9.GA, 7.1.1.GA
    • CDI / Weld
    • None
    • Hide
      To apply this individual patch, follow the steps outlined in How do I apply individual or cumulative patches in JBoss EAP 6.2 and beyond [1]?

          To rollback this individual patch if installation has unexpected consequences, follow the steps outlined in How do I rollback individual or cumulative patches in JBoss EAP 6.2 and beyond [2]?

              [1] https://access.redhat.com/site/solutions/625683
              [2] https://access.redhat.com/site/solutions/639403
      Show
      To apply this individual patch, follow the steps outlined in How do I apply individual or cumulative patches in JBoss EAP 6.2 and beyond [1]?     To rollback this individual patch if installation has unexpected consequences, follow the steps outlined in How do I rollback individual or cumulative patches in JBoss EAP 6.2 and beyond [2]?         [1] https://access.redhat.com/site/solutions/625683         [2] https://access.redhat.com/site/solutions/639403

      WAR CDI bean is failing to inject a CDI bean from a module-alias exported dependency. war -module-alias -> static module X -> static module Y (containing CDI Beans)
      A WAR uses a module-alias with the slot attribute. This module-alias is referenced in jboss-deployment-structure.xml:

      <jboss-deployment-structure> 
      	 <deployment>
      		<dependencies>
      			<module name="mycompany.test.CDIJarMaven" slot="moduloAliasError" meta-inf="export" annotations="true" />
      		</dependencies>      
          </deployment>
      </jboss-deployment-structure>
      

      moduleAliasError which the app has the target moduloNivel2:

      <module-alias xmlns="urn:jboss:module:1.1" name="mycompany.test.CDIJarMaven" slot="moduloAliasError" target-name="mycompany.test.CDIJarMaven" target-slot="moduloNivel2"/>
      

      moduloNivel2 which the modulo-alias references depends on main module and is including/exporting META-INF where the beans.xml is located:

      <module xmlns="urn:jboss:module:1.5" name="mycompany.test.CDIJarMaven">
          <resources>
              <resource-root path="CDIJarMaven.jar"/>
          </resources>
          <dependencies>
      		<module name="javax.faces.api" export="true"/>
      		
      		<!-- Timer de ejbs para el log de acceso-->
      		<module name="javax.ejb.api"/>
      		<module name="javax.enterprise.api" />
          </dependencies>
      </module>
      {code:java}
      
      modulo main contains the jar with the CDI beans and has a META-INF/beans.xml in it:
      {code:java}
      <module xmlns="urn:jboss:module:1.1" name="mycompany.test.CDIJarMaven" slot="moduloNivel2">
          <dependencies>
      		<module name="mycompany.test.CDIJarMaven" slot="main" export="true">
       			<imports>
                      <include path="META-INF**" />
                  </imports>
                  <exports>  
                      <include path="META-INF**" />
                  </exports>  
              </module>
          </dependencies>
      </module>
      

      The error we get is:

      WELD-001408: Unsatisfied dependencies for type PruebaDTO with qualifiers @Default
        at injection point [BackedAnnotatedField] @Inject private backingbeans.Page1.paginacion
        at backingbeans.Page1.paginacion(Page1.java:0)
      

      Checking the code one can see how the beans.xml is seen :

      EXTERNAL BeanDeploymentArchive (awar-mock02.war.external.jar:file:/jboss-eap-7.1/modules/mycompany/test/CDIJarMaven/main/CDIJarMaven.jar!/META-INF/beans.xml)
      

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

                Created:
                Updated:
                Resolved: