[arquillian-issues] [JBoss JIRA] (ARQ-910) JNDI lookup fails for @EJB mappedName when the bean has more instances

Josef Cacek (JIRA) jira-events at lists.jboss.org
Thu May 3 04:59:17 EDT 2012


Josef Cacek created ARQ-910:
-------------------------------

             Summary: JNDI lookup fails for @EJB mappedName when the bean has more instances
                 Key: ARQ-910
                 URL: https://issues.jboss.org/browse/ARQ-910
             Project: Arquillian
          Issue Type: Bug
      Security Level: Public (Everyone can see)
            Reporter: Josef Cacek
            Priority: Critical


EJBs are not injected correctly to a test case if they come from different applications.
For instance following code:
{code}
@EJB(mappedName = "java:global/test-app1/HelloBean")
private Hello hello1;

@EJB(mappedName = "java:global/test-app2/HelloBean")
private Hello hello2;

@Deployment(name = "DEP1")
public static JavaArchive deploymentApp1() throws IllegalArgumentException, IOException {
    return createJar("test-app1.jar");
}

@Deployment(name = "DEP2")
public static JavaArchive deploymentApp2() throws IllegalArgumentException, IOException {
    return createJar("test-app2.jar");
}

@Test
@OperateOnDeployment("DEP1")
public void test1() throws Exception {
    assertNotNull(hello1);
}

@Test
@OperateOnDeployment("DEP2")
public void test2() throws Exception {
    assertNotNull(hello2);
}
{code}
Then one of the tests fails and one passes (sometime test1, sometime test2).


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the arquillian-issues mailing list