Wrong JNDI context returned from EJB
ropalka Apr 2, 2010 8:23 AMHi EJB team,
This is related to issue: https://jira.jboss.org/jira/browse/JBAS-7888
I'm analyzing this failure:
http://jbossws.jboss.org:8180/hudson/job/AS-TESTS-AS-6.0.1/113/testReport/
To reproduce the problem, just type:
cd jbossas/trunk/testsuite
./build.sh clean main
./build.sh -Dtest=org.jboss.test.ws.jaxws.ejb3Integration.injection.InjectionTestCase one-test
I found it started to fail since:
http://jbossws.jboss.org:8180/hudson/job/AS-6.0.1/109/
I think it might be related to:
https://jira.jboss.org/jira/browse/JBAS-7854
Here are my investigations:
Our archive structure is:
jbossas/trunk/testsuite/output/lib]>jar -tvf jaxws-injection.ear
0 Fri Apr 02 12:20:46 CEST 2010 META-INF/
102 Fri Apr 02 12:20:44 CEST 2010 META-INF/MANIFEST.MF
602 Fri Apr 02 12:20:46 CEST 2010 META-INF/application.xml
7367 Fri Apr 02 12:20:46 CEST 2010 jaxws-injection-ejb3.jar
9000 Fri Apr 02 12:20:46 CEST 2010 jaxws-injection-pojo.war
2323 Fri Apr 02 13:54:46 CEST 2010 jaxws-injection.jar
Relevant JNDI trees are (from JMX console):
java:comp namespace of the component jboss.j2ee:ear=jaxws-injection.ear,jar=jaxws-injection.jar,name=BeanImpl,service=EJB3 :
+- EJBContext (class: javax.ejb.EJBContext)
+- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
+- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
+- env (class: org.jnp.interfaces.NamingContext)
+- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
java:comp namespace of the component jboss.j2ee:ear=jaxws-injection.ear,jar=jaxws-injection-ejb3.jar,name=EJB3Bean,service=EJB3 :
+- EJBContext (class: javax.ejb.EJBContext)
+- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
+- UserTransaction (class: org.jboss.ejb3.tx.UserTransactionImpl)
+- env (class: org.jnp.interfaces.NamingContext)
| +- org.jboss.test.ws.jaxws.ejb3Integration.injection.webservice.AbstractEndpointImpl (class: org.jnp.interfaces.NamingContext)
| | +- testBean2[link -> jaxws-injection/BeanImpl/local-org.jboss.test.ws.jaxws.ejb3Integration.injection.shared.BeanIface] (class: javax.naming.LinkRef)
| | +- bean[link -> jaxws-injection/BeanImpl/local-org.jboss.test.ws.jaxws.ejb3Integration.injection.shared.BeanIface] (class: javax.naming.LinkRef)
| +- boolean1 (class: java.lang.Boolean)
+- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
In our JBossWS AS Integration layer we're lookuping the JNDI context as:
public Context getJNDIContext(final Endpoint ep) throws NamingException
{
final EJBContainer ejb3Container = (EJBContainer)getEjb3Container("jboss.j2ee:ear=jaxws-injection.ear,jar=jaxws-injection-ejb3.jar,name=EJB3Bean,service=EJB3");
return (Context)ejb3Container.getEnc().lookup("java:env/");
}
This call used to return proper JNDI tree associated with
jboss.j2ee:ear=jaxws-injection.ear,jar=jaxws-injection-ejb3.jar,name=EJB3Bean,service=EJB3.
Unfortunately these days in AS trunk it returns the JNDI tree associated with
jboss.j2ee:ear=jaxws-injection.ear,jar=jaxws-injection.jar,name=BeanImpl,service=EJB3
IMHO this is a bug in EJB code base.