1 Reply Latest reply on Sep 17, 2002 1:41 PM by David Jencks

    Throwing EJBException in a nested entity

    Ravichandra Ryali Newbie

      Hi,

      When I throw an EJBException in entity2 which is called by entity1 as given below:
      code:

      entity1:
      ejbCreate()
      {
      entity2Home.create()
      }

      entity2:
      ejbCreate()
      {
      catch(SQLException)
      {
      throw new EJBException(SQLException)
      }

      The above code is throwing me this stack trace:

      13:43:15,125 INFO [LocalTxConnectionManager$LocalConnectionEventListener] Could not enlist XAResource!

      javax.transaction.RollbackException: Already marked for rollback

      at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:625)

      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:103)

      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.enlist(LocalTxConnectionManager.java:320)

      at org.jboss.resource.connectionmanager.LocalTxConnectionManager.managedConnectionReconnected(LocalTxConnectionManager.java:255)

      at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnect(BaseConnectionManager2.java:591)

      at org.jboss.resource.connectionmanager.CachedConnectionManager.reconnect(CachedConnectionManager.java:331)

      at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:153)

      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:219)

      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)

      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)

      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)

      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)

      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)

      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)

      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)

      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)

      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:227)

      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)

      at $Proxy132.create(Unknown Source)

      at com.marketron.ar.services.PaymentServiceProvider.createPayment(PaymentServiceProvider.java:237)

      at com.marketron.ar.services.PaymentServiceBean.createPayment(PaymentServiceBean.java:104)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)

      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)

      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)

      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)

      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)

      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)

      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)

      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)

      at org.jboss.ejb.Container.invoke(Container.java:705)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)

      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)

      at java.lang.reflect.Method.invoke(Native Method)

      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)

      at sun.rmi.transport.Transport$1.run(Transport.java:152)

      at java.security.AccessController.doPrivileged(Native Method)

      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)

      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)

      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)

      at java.lang.Thread.run(Thread.java:484)

      13:43:15,135 INFO [LocalTxConnectionManager] Could not enlist in transaction on entering meta-aware object!

      javax.transaction.SystemException: Could not enlist XAResource!javax.transaction.RollbackException: Already marked for rollback

      at org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener.enlist(LocalTxConnectionManager.java:329)

      at org.jboss.resource.connectionmanager.LocalTxConnectionManager.managedConnectionReconnected(LocalTxConnectionManager.java:255)

      at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnect(BaseConnectionManager2.java:591)

      at org.jboss.resource.connectionmanager.CachedConnectionManager.reconnect(CachedConnectionManager.java:331)

      at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:153)

      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:219)

      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)

      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)

      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)

      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)

      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)

      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:104)

      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)

      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)

      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:227)

      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)

      at $Proxy132.create(Unknown Source)

      at com.marketron.ar.services.PaymentServiceProvider.createPayment(PaymentServiceProvider.java:237)

      at com.marketron.ar.services.PaymentServiceBean.createPayment(PaymentServiceBean.java:104)

      at java.lang.reflect.Method.invoke(Native Method)

      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)

      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)

      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)

      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)

      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)

      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)

      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)

      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)

      at org.jboss.ejb.Container.invoke(Container.java:705)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)

      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:362)

      at java.lang.reflect.Method.invoke(Native Method)

      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)

      at sun.rmi.transport.Transport$1.run(Transport.java:152)

      at java.security.AccessController.doPrivileged(Native Method)

      at sun.rmi.transport.Transport.serviceCall(Transport.java:148)

      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465)

      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706)