You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Forrest Xia (JIRA)" <ji...@apache.org> on 2010/06/02 18:44:37 UTC

[jira] Created: (OPENEJB-1288) Some jndi name change cause javax.naming.NotContextException

Some jndi name change cause javax.naming.NotContextException
------------------------------------------------------------

                 Key: OPENEJB-1288
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1288
             Project: OpenEJB
          Issue Type: Bug
          Components: container system
    Affects Versions: 3.1.3
            Reporter: Forrest Xia


When I run a EJB test case in geronimo 2.2.1-snapshot, an javax.naming.NotContextException throws out like this:
2010-06-02 16:47:20,656 ERROR [OpenEJB] The bean instance mejb/ejb/mgmt/MEJB threw a system exception:javax.naming.NotContextException: The intermediate context EJBContext does not exist
javax.naming.NotContextException: The intermediate context EJBContext does not exist
	at org.apache.xbean.naming.context.AbstractContext.lookupFinalContext(AbstractContext.java:198)
	at org.apache.xbean.naming.context.AbstractContext.addDeepBinding(AbstractContext.java:241)
	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:660)
	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:651)
	at org.apache.openejb.core.stateless.StatelessInstanceManager.ceateInstance(StatelessInstanceManager.java:180)
	at org.apache.openejb.core.stateless.StatelessInstanceManager.getInstance(StatelessInstanceManager.java:151)
	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:136)
	at org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
	at org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
	at org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:196)
	at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:149)
	at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:71)
	at org.apache.openejb.server.ejbd.KeepAliveServer$Session.service(KeepAliveServer.java:213)
	at org.apache.openejb.server.ejbd.KeepAliveServer.service(KeepAliveServer.java:233)
	at org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:66)
	at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:91)
	at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:120)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)

After tracing back the stack, found an jndi name change caused the problem. I see some code snippet:
synchronized(this){
                try {
                    sessionContext = (SessionContext) ctx.lookup("comp/EJBContext");
                } catch (NamingException e1) {
                    sessionContext = createSessionContext(deploymentInfo);
                    // TODO: This should work
                    ctx.bind("comp/EJBContext", sessionContext);
                }
            }
Seems the jndi name "comp/EJBContext" does not work for Geronimo. After changing them back to "java:comp/EJBContext". The test case passes.

So maybe we need to revert some changes back from openejb-1014.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.