[jboss-jira] [JBoss JIRA] (WFLY-4419) Dependency on a deployed CDI module - beans are not injected

Stuart Douglas (JIRA) issues at jboss.org
Tue Mar 31 23:23:18 EDT 2015


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

Stuart Douglas resolved WFLY-4419.
----------------------------------
    Fix Version/s: 9.0.0.Beta2
       Resolution: Done


I tested against 9.0.0.Beta2, so it sounds like this has already been fixed.

> Dependency on a deployed CDI module - beans are not injected
> ------------------------------------------------------------
>
>                 Key: WFLY-4419
>                 URL: https://issues.jboss.org/browse/WFLY-4419
>             Project: WildFly
>          Issue Type: Feature Request
>          Components: CDI / Weld
>    Affects Versions: 8.2.0.Final
>            Reporter: Dirk Buchhorn
>            Assignee: Stuart Douglas
>             Fix For: 9.0.0.Beta2
>
>
> I want to deploy two modules to wildfly 8.2.0 The module-a contains beans (and later CDI producer and other stuff) and module-b use this beans. Beans from module-a should be injected with CDI in module-b (There is a beans.xml in both modules.). All works fine if the module-a is direct referenced as dependency like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
>   <deployment>
>   <dependencies>
>   <module name="deployment.module-a-1.0.0.jar" meta-inf="import" />
>   </dependencies>
>   </deployment>
> </jboss-deployment-structure>
>  
> But the dependency to module-a should be without to know the deployed version, so I tried to set a module alias and (or) to re-export module-a under a different name like this.
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
>   <deployment>
>   <module-alias name="deployment.module-a-alias" />
>   </deployment>
> </jboss-deployment-structure>
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
>   <module name="deployment.module-a">
>   <module-alias name="deployment.module-a-alias" />
>   <dependencies>
>   <module name="deployment.module-a-1.0.0.jar" export="true" meta-inf="export" />
>   </dependencies>
>   </module>
> </jboss-deployment-structure>
>  
> But either the module alias or a re-export under a new module name worked. The reported exception is always:
> Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type XYZ with qualifiers @Default
>  
> The module alias fit my requirements and I guess is should work with CDI but it dosn't.
> Two questions:
> - Why CDI don't work with module alias and module re-export?
> - How to deal with dependencies and module versions?



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list