[weld-issues] [JBoss JIRA] Created: (WELD-889) @Inject fails for EJBs not defined in web module

henk de boer (JIRA) jira-events at lists.jboss.org
Mon Apr 18 18:57:33 EDT 2011


@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