[jboss-jira] [JBoss JIRA] (WFLY-10278) Bean discovery in deployment dependencies (modules) fails to inject from static module-alias's exported dependency

Lin Gao (JIRA) issues at jboss.org
Fri Apr 20 08:31:01 EDT 2018


     [ https://issues.jboss.org/browse/WFLY-10278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lin Gao moved JBEAP-14658 to WFLY-10278:
----------------------------------------

              Project: WildFly  (was: JBoss Enterprise Application Platform)
                  Key: WFLY-10278  (was: JBEAP-14658)
             Workflow: GIT Pull Request workflow   (was: CDW with loose statuses v1)
          Component/s: CDI / Weld
                           (was: CDI / Weld)
    Affects Version/s:     (was: 7.1.1.GA)
                           (was: 7.0.9.GA)
        Fix Version/s:     (was: 7.1.3.GA)


> Bean discovery in deployment dependencies (modules) fails to inject from static module-alias's exported dependency
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-10278
>                 URL: https://issues.jboss.org/browse/WFLY-10278
>             Project: WildFly
>          Issue Type: Bug
>          Components: CDI / Weld
>            Reporter: Lin Gao
>            Assignee: JBoss SET
>
> 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:
> {code:java}
> <jboss-deployment-structure> 
> 	 <deployment>
> 		<dependencies>
> 			<module name="mycompany.test.CDIJarMaven" slot="moduloAliasError" meta-inf="export" annotations="true" />
> 		</dependencies>      
>     </deployment>
> </jboss-deployment-structure>
> {code}
> moduleAliasError which the app has the target moduloNivel2:
> {code}
> <module-alias xmlns="urn:jboss:module:1.1" name="mycompany.test.CDIJarMaven" slot="moduloAliasError" target-name="mycompany.test.CDIJarMaven" target-slot="moduloNivel2"/>
> {code}
> moduloNivel2 which the modulo-alias references depends on main module and is including/exporting META-INF where the beans.xml is located:
> {code:java}
> <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>
> {code}
> The error we get is:
> {code:java}
> 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)
> {code}
> Checking the code one can see how the beans.xml is seen :
> {code:java}
> EXTERNAL BeanDeploymentArchive (awar-mock02.war.external.jar:file:/jboss-eap-7.1/modules/mycompany/test/CDIJarMaven/main/CDIJarMaven.jar!/META-INF/beans.xml)
> {code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list