1 Reply Latest reply on Nov 20, 2002 1:49 PM by Daniel Sieroka

    Could not enlist XAResource!

    Erik Turesson Novice

      Hello!

      I am using jboss 3.0.3.
      I have a number of session beans accessing the 2.0 CMP entity beans. The transaction attribute for my session beans is set to Required.

      I have a number of JSP pages accessing the session beans.
      Everything works fine until one some of my session beans detects an error and marks the transaction for rollback.
      I do not perform any manual transaction handling except marking them for rollback when an error occurs.

      If an error occurs and the transaction is marked for rollback I sometimes receives the stacktrace below when accessing some other session bean later. If I mark the methods in those session beans with RequiresNew instead the error does not occur. It seams to me that JBoss is trying to reuse the transaction that is already marked for rollback instead of creating a new one.

      Whats wrong?

      /Erik

      2002-11-01 10:02:28,624 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectionEventListener] Could not enlist XAResource!
      javax.transaction.RollbackException: Already marked for rollback
      at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:670)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:102)
      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.allocateConnection(BaseConnectionManager2.java:534)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:92)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:44)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:541)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:336)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:301)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:636)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntityMultiInstanceInterceptor.invokeHome(EntityMultiInstanceInterceptor.java:76)
      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:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy68.findByPrimaryKey(Unknown Source)
      at com.proventek.scj.site.implementation.SiteManagerBean.getSiteLocal(SiteManagerBean.java:146)
      at com.proventek.scj.site.implementation.SiteManagerBean.getSite(SiteManagerBean.java:402)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      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:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy111.getSite(Unknown Source)
      at com.proventek.scj.page.misc.scj._jspService(scj.java:136)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:356)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:285)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1614)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:531)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:785)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:942)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:800)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:200)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:294)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:741)
      at java.lang.Thread.run(Thread.java:479)