[jboss-jira] [JBoss JIRA] (AS7-4567) Weld does not find CDI Beans within AS7 modules
Marek Schmidt (JIRA)
jira-events at lists.jboss.org
Mon Mar 25 07:02:42 EDT 2013
[ https://issues.jboss.org/browse/AS7-4567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762889#comment-12762889 ]
Marek Schmidt edited comment on AS7-4567 at 3/25/13 7:00 AM:
-------------------------------------------------------------
[~juan.hernandez]
Your module needs to define EE API dependencies in the module module.xml file (at least those that are used in the module), e.g.
{code}
<module xmlns="urn:jboss:module:1.1" name="org.jboss.test.fooModule">
<resources>
<resource-root path="fooTest.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.ejb.api"/>
<module name="javax.resource.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.inject.api"/>
<module name="javax.interceptor.api"/>
<module name="javax.validation.api"/>
<module name="org.hibernate.validator"/>
<module name="javax.xml.stream.api"/>
</dependencies>
</module>
{code}
was (Author: maschmid):
[~juan.hernandez]
Your module needs to define EE API dependencies in the module module.xml file (at least those that are used in the module), e.g.
<module xmlns="urn:jboss:module:1.1" name="org.jboss.test.fooModule">
<resources>
<resource-root path="fooTest.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.ejb.api"/>
<module name="javax.resource.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.inject.api"/>
<module name="javax.interceptor.api"/>
<module name="javax.validation.api"/>
<module name="org.hibernate.validator"/>
<module name="javax.xml.stream.api"/>
</dependencies>
</module>
> Weld does not find CDI Beans within AS7 modules
> -----------------------------------------------
>
> Key: AS7-4567
> URL: https://issues.jboss.org/browse/AS7-4567
> Project: Application Server 7
> Issue Type: Feature Request
> Components: CDI / Weld
> Affects Versions: 7.1.0.Final, 7.1.1.Final
> Reporter: Gernot P
> Assignee: Stuart Douglas
> Fix For: EAP 6.1.0.Alpha (7.2.0.Final)
>
>
> I've a my.jar which contains cdi beans and cdi producer methods and a META-INF/beans.xml file.
> Putting this jar to WEB-INF/lib in my war, the web app can use the cdi producer methods of my.jar.
> After moving my.jar from WEB-INF/lib to a AS7 module(and adding a dependency in the war's MANIFEST.MF) AS7 reports
> org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [BeanXY] with qualifiers [@Default] at injection point [[field] @Inject
> It seams that weld does not (or cannot) scan my.jar which is inside AS7 module. (instantiating BeanXY directly ("new BeanXY()") works - so the module is loaded correctly)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list