tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravindranath Akila <ravindranathak...@gmail.com>
Subject Non-Application Exception in Session Bean Cascades Destruction of Other Session Beans?
Date Thu, 17 Jun 2010 20:33:32 GMT
Hello,
  Below I have pasted a non-application exception. (This is an exception
which occured due to an error in persisting an entity).

  The problem I am facing is that,

  The container will as expected, destroy the session bean in which the
non-application exception occurred.
  This session bean however, is a class variable injected into ANOTHER
session bean.
  This means, its destruction will cause the wrapping(enclosing) session
bean to be unstable too.
  However, does the container destroy this enclosing session bean too? Is
this scenario handled?

  What happens to me is that I think a new lookup just leaves the thread
hanging.

  Am I doing something wrong here? What happens to the enclosing session
bean? Am I to expect "Reference is Invalid" message?

  Thanks in advance.


  P.S.

  From the spec ejb-3_1-fr section 14.2.2

  "• Unless the bean is a Singleton bean, no other method will be invoked on
an instance that threw
a non-application exception.

This means that unless the bean is a Singleton the Bean Provider does not
have to perform any cleanup
actions before throwing a non-application exception. It is the container
that is responsible for the
cleanup."



  http-8080-4|2010-06-17 22:44:31,890|EXCEPTION:42>SORRY! I ENCOUNTERED AN
EXCEPTION! HOWEVER, THE APPLICATION SHOULD REMAIN INTACT. SEE BELOW FOR MORE
DETAILS.

  Due to System Error(s) The Operation FAILED!


  javax.ejb.EJBException: The bean encountered a non-application exception;
nested exception is:
          javax.ejb.EJBTransactionRolledbackException: The transaction has
been marked rollback only because the bean encountered a non-application
exception :org.apache.openjpa.persistence.OptimisticLockException :
Optimistic locking errors were detected when flushing to the data store.
The following objects may have been concurrently modified in another
transaction: [ai.ilikeplaces.entities.Url-Url{url='5@akila.com', type=0}]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:363)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:291)
[openejb-core-3.1.jar:3.1]
          at $Proxy92.doUHumansPublicURL(Unknown Source) [na:na]
          at
ai.ilikeplaces.logic.crud.HumanCRUDHuman.doUHumansPublicURL(HumanCRUDHuman.java:305)
[HumanCRUDHuman.class:na]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[na:1.6.0_16]
          at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[na:1.6.0_16]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at
ai.ilikeplaces.util.RuntimeExceptionWrapper.profile(RuntimeExceptionWrapper.java:21)
[RuntimeExceptionWrapper.class:na]
          at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
[na:na]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at ai.ilikeplaces.util.MethodParams.profile(MethodParams.java:44)
[MethodParams.class:na]
          at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
[na:na]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at ai.ilikeplaces.util.MethodTimer.profile(MethodTimer.java:46)
[MethodTimer.class:na]
          at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
[na:na]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at
ai.ilikeplaces.util.ParamValidator.validate(ParamValidator.java:48)
[ParamValidator.class:na]
          at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
[na:na]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:211)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
[openejb-core-3.1.jar:3.1]
          at $Proxy80.doUHumansPublicURL(Unknown Source) [na:na]
          at
ai.ilikeplaces.logic.Listeners.widgets.Profile$2.handleEvent(Profile.java:90)
[Profile$2.class:na]
          at
org.itsnat.impl.core.listener.EventListenerUtil.handleEventListeners(EventListenerUtil.java:38)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.listener.EventListenerUtil.handleEventListeners(EventListenerUtil.java:59)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.listener.EventListenerUtil.handleEventIncludingGlobalListeners(EventListenerUtil.java:86)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.listener.ItsNatDOMEventListenerWrapperImpl.handleEvent(ItsNatDOMEventListenerWrapperImpl.java:150)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.listener.domstd.ItsNatDOMStdEventListenerWrapperImpl.handleEvent(ItsNatDOMStdEventListenerWrapperImpl.java:73)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.listener.ItsNatDOMEventListenerWrapperImpl.processEvent(ItsNatDOMEventListenerWrapperImpl.java:115)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.resp.norm.ResponseNormalEventImpl.processEvent(ResponseNormalEventImpl.java:75)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.resp.norm.ResponseNormalEventImpl.process(ResponseNormalEventImpl.java:59)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.resp.ResponseImpl.process(ResponseImpl.java:77)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.req.norm.RequestNormalEventImpl.processClientDocumentThreadSync(RequestNormalEventImpl.java:120)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.req.norm.RequestNormalEventImpl$1.syncMethod(RequestNormalEventImpl.java:105)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.doc.ItsNatDocSynchronizerImpl.exec(ItsNatDocSynchronizerImpl.java:56)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.req.norm.RequestNormalEventImpl.processClientDocument(RequestNormalEventImpl.java:108)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.req.norm.RequestNormalEventImpl.processClientDocument(RequestNormalEventImpl.java:85)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.req.RequestEventImpl.process(RequestEventImpl.java:137)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.ItsNatServletRequestImpl.process(ItsNatServletRequestImpl.java:212)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.http.ItsNatHttpServletImpl.processRequest(ItsNatHttpServletImpl.java:56)
[ItsNat.jar:0.7]
          at
org.itsnat.impl.core.http.ItsNatHttpServletImpl.processRequest(ItsNatHttpServletImpl.java:61)
[ItsNat.jar:0.7]
          at
org.itsnat.core.http.HttpServletWrapper.processRequest(HttpServletWrapper.java:79)
[ItsNat.jar:0.7]
          at
org.itsnat.core.http.HttpServletWrapper.doPost(HttpServletWrapper.java:104)
[ItsNat.jar:0.7]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
[servlet-api.jar:na]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[servlet-api.jar:na]
          at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
[catalina.jar:na]
          at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[catalina.jar:na]
          at
ai.ilikeplaces.servlets.filters.LogoutNRedirect.doFilter(LogoutNRedirect.java:68)
[LogoutNRedirect.class:na]
          at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
[catalina.jar:na]
          at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[catalina.jar:na]
          at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
[catalina.jar:na]
          at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
[catalina.jar:na]
          at
org.apache.openejb.tomcat.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
[openejb-tomcat-catalina-3.1.jar:3.1]
          at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
[catalina.jar:na]
          at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[catalina.jar:na]
          at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[catalina.jar:na]
          at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
[catalina.jar:na]
          at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
[tomcat-coyote.jar:na]
          at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
[tomcat-coyote.jar:na]
          at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
[tomcat-coyote.jar:na]
          at java.lang.Thread.run(Thread.java:619) [na:1.6.0_16]
  Caused by: javax.ejb.EJBTransactionRolledbackException: The transaction
has been marked rollback only because the bean encountered a non-application
exception :org.apache.openjpa.persistence.OptimisticLockException :
Optimistic locking errors were detected when flushing to the data store.
The following objects may have been concurrently modified in another
transaction: [ai.ilikeplaces.entities.Url-Url{url='5@akila.com', type=0}]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:345)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:291)
[openejb-core-3.1.jar:3.1]
          at $Proxy101.create(Unknown Source) [na:na]
          at
ai.ilikeplaces.logic.crud.unit.UHumansIdentity.doUHumansPublicURL(UHumansIdentity.java:53)
[UHumansIdentity.class:na]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[na:1.6.0_16]
          at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[na:1.6.0_16]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:211)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
[openejb-core-3.1.jar:3.1]
          ... 78 common frames omitted
  Caused by: org.apache.openjpa.persistence.OptimisticLockException:
Optimistic locking errors were detected when flushing to the data store.
The following objects may have been concurrently modified in another
transaction: [ai.ilikeplaces.entities.Url-Url{url='5@akila.com', type=0}]
          at
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2157)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2007)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1905)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1676)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:989)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:592)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openejb.persistence.JtaEntityManager.flush(JtaEntityManager.java:130)
[openejb-core-3.1.jar:3.1]
          at ai.ilikeplaces.jpa.CrudService.create(CrudService.java:49)
[CrudService.class:na]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[na:1.6.0_16]
          at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[na:1.6.0_16]
          at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[na:1.6.0_16]
          at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_16]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:158)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:141)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:211)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:169)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
[openejb-core-3.1.jar:3.1]
          at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
[openejb-core-3.1.jar:3.1]
          ... 92 common frames omitted
  Caused by: org.apache.openjpa.persistence.OptimisticLockException: An
optimistic lock violation was detected when flushing object instance
"ai.ilikeplaces.entities.Url-Url{url='5@akila.com', type=0}" to the data
store.  This indicates that the object was concurrently modified in another
transaction.
          at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:124)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:82)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:56)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:549)
[openjpa-1.1.0.jar:1.1.0]
          at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
[openjpa-1.1.0.jar:1.1.0]
        ... 111 common frames omitted

-- 
  Akila...

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message