[weld-issues] [JBoss JIRA] Commented: (WELD-889) @Inject fails for EJBs not defined in web module
Pete Muir (JIRA)
jira-events at lists.jboss.org
Thu Apr 21 07:48:18 EDT 2011
[ https://issues.jboss.org/browse/WELD-889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597036#comment-12597036 ]
Pete Muir commented on WELD-889:
--------------------------------
Please provide stack trace.
> @Inject fails for EJBs not defined in web module
> ------------------------------------------------
>
> Key: WELD-889
> URL: https://issues.jboss.org/browse/WELD-889
> Project: Weld
> Issue Type: Bug
> Components: Resolution (Typesafe and by Name)
> Affects Versions: 1.1.0.Beta2
> Environment: JBoss AS 6 Final
> Reporter: henk de boer
>
> Trying to inject an EJB bean using @Inject into a bean in a web module fails when the EJB in question is defined in an EJB module. Injecting an EJB that is defined in the web module works as expected.
> The exception raised is:
> org.jboss.weld.exceptions.CreationException: WELD-000079 Could not find the EJB in JNDI
> Example:
> @RequestScoped
> public class MyBeanA {
>
> @Inject
> private UserDAOA userDAO; // EJB defined in EJB module, fails
> public void test() {
> userDao.getByID(...);
> }
> }
> @RequestScoped
> public class MyBeanB {
>
> @Inject
> private UserDAO userDAOB; // EJB defined in (same) web module, works
> public void test() {
> userDao.getByID(...);
> }
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues
mailing list