geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manu T George (JIRA)" <j...@apache.org>
Subject [jira] Commented: (GERONIMO-3444) EJBContext
Date Wed, 29 Aug 2007 06:55:30 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-3444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523480
] 

Manu T George commented on GERONIMO-3444:
-----------------------------------------

Yes this is a threading issue. Thanks for the analysis Aman. Since there is only one JNDI
Enc per deployed EJB but many instances may be created with the getInstance() method this
block should be synchronized. 
The same scenario repeats for StatefulInstanceManager and MdbInstanceFactory. Also for the
web service context. Fixed this in trunk of OpenEJB.

> EJBContext
> ----------
>
>                 Key: GERONIMO-3444
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3444
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: OpenEJB
>    Affects Versions: 2.0.x
>         Environment: Windows XP SP2
>            Reporter: Aman Nanner
>             Fix For: 2.0.x, 2.1
>
>
> During the initial running of our J2EE application, the following error inconsistently
occurs:
> {panel:title="Stack Trace"}
> 16:49:57,268 ERROR [OpenEJB] The bean instance null threw a system exception:javax.naming.NameAlreadyBoundException:
EJBContext
> javax.naming.NameAlreadyBoundException: EJBContext
> 	at org.apache.xbean.naming.context.WritableContext.addBinding(WritableContext.java:91)
> 	at org.apache.xbean.naming.context.WritableContext$NestedWritableContext.addBinding(WritableContext.java:235)
> 	at org.apache.xbean.naming.context.AbstractContext.addBinding(AbstractContext.java:320)
> 	at org.apache.xbean.naming.context.AbstractContext.addDeepBinding(AbstractContext.java:240)
> 	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:652)
> 	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:643)
> 	at org.apache.openejb.core.stateless.StatelessInstanceManager.getInstance(StatelessInstanceManager.java:111)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:156)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:211)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:65)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:320)
> 	at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
> 	at $Proxy164.executeUpdate(Unknown Source)
> 	at com.mxi.mx.common.ejb.job.StaleJobResetJobBean.processMessage(StaleJobResetJobBean.java:79)
> 	at com.mxi.mx.common.ejb.job.MxMessageDrivenBean.onMessage(MxMessageDrivenBean.java:135)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:146)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
> 	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:332)
> 	at org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:304)
> 	at org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:229)
> 	at org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:170)
> 	at $Proxy163.onMessage(Unknown Source)
> 	at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
> 	at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
> 	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:696)
> 	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
> 	at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:290)
> 	at org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
> 	at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:201)
> 	at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:331)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> 16:49:57,284 ERROR [MxMessageDrivenBean] Error executing stale job reset job
> javax.ejb.EJBException: Cannot obtain a free instance.; nested exception is: 
> 	javax.naming.NameAlreadyBoundException: EJBContext
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:365)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:322)
> 	at org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
> 	at $Proxy164.executeUpdate(Unknown Source)
> 	at com.mxi.mx.common.ejb.job.StaleJobResetJobBean.processMessage(StaleJobResetJobBean.java:79)
> 	at com.mxi.mx.common.ejb.job.MxMessageDrivenBean.onMessage(MxMessageDrivenBean.java:135)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:146)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
> 	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:332)
> 	at org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:304)
> 	at org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:229)
> 	at org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:170)
> 	at $Proxy163.onMessage(Unknown Source)
> 	at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:121)
> 	at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:61)
> 	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:696)
> 	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165)
> 	at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:290)
> 	at org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
> 	at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:201)
> 	at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:331)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.naming.NameAlreadyBoundException: EJBContext
> 	at org.apache.xbean.naming.context.WritableContext.addBinding(WritableContext.java:91)
> 	at org.apache.xbean.naming.context.WritableContext$NestedWritableContext.addBinding(WritableContext.java:235)
> 	at org.apache.xbean.naming.context.AbstractContext.addBinding(AbstractContext.java:320)
> 	at org.apache.xbean.naming.context.AbstractContext.addDeepBinding(AbstractContext.java:240)
> 	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:652)
> 	at org.apache.xbean.naming.context.AbstractContext.bind(AbstractContext.java:643)
> 	at org.apache.openejb.core.stateless.StatelessInstanceManager.getInstance(StatelessInstanceManager.java:111)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:156)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:211)
> 	at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:65)
> 	at org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:320)
> 	... 27 more
> {panel}
> This error occurs only some of the time, which leads me to believe there is a threading
issue here.  Specifically, looking at the following code fragment in {{org.apache.openejb.core.stateless.StatelessInstanceManager.getInstance(StatelessInstanceManager.java:111)}}:
> {code}
>                 Context ctx = deploymentInfo.getJndiEnc();                
>                 SessionContext sessionContext;
>                 try {
>                     sessionContext = (SessionContext) ctx.lookup("java:comp/EJBContext");
>                 } catch (NamingException e1) {
>                     sessionContext = createSessionContext();
>                     // TODO: This should work
>                     ctx.bind("java:comp/EJBContext", sessionContext);
>                 }   
> {code}
> It could be perhaps that the "java:/comp/EJBContext" is not initially found, but another
thread creates it by the time it is attempted to be bound in the last line.  Unfortunately,
I do not have a reproducible test case at the current time.

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


Mime
View raw message