0 Replies Latest reply on Dec 18, 2002 6:47 PM by Tim Bauer

    JBoss.org HELP - Errors with XAResource and LocalTxConnectio

    Tim Bauer Novice

      I have a clinical scheduling application which uses Entity Beans for create/modify/remove and Stateless Session Beans for the main facility administrator screens. The web servlets instaniate an instance of the Stateless session bean ICSRegSQLFinderUtilsEJB which executes direct SQL queries to the database (getting the datasouce connection from the container) to fill data models to pass back to the JSP's. When 1 or 2 people use this system it seems fine, but when 3 or more start using it I start to get conflicts and errors thrown by LocalTxConnectionManager or XAResource (SEE LOG BELOW).

      The financial potential for this application is huge, and would be a great victory for getting JBoss into the clinical IT world.

      Can someone (expert) please review the log below and help me figure what's going wrong???

      Configuration:
      JBoss 3.0.3
      Mac OS X (10.2.2)
      MySQL 3.23.53
      mysql-connector-java-2.0.14-bin.jar

      Error Log:

      14:47:55,504 ERROR [STDERR] An error has happened: SELECT r.shift_request_id, x.shift_id, x.shift_begin_date, x.shift_end_date, x.department_id, x.facility_id, x.user_type_id, x.staff_release_date, x.agency_release_date, x.shift_status_id, x.created_user_id, x.created_date, x.lastmodified_user_id, x.lastmodified_date, f.facility_name, d.department_name, ut.user_type_name, z.shift_status_name, x.shift_quantity, r.agency_id, r.request_priority, r.request_status_id, u.firstname, u.middlename, u.lastname, r.isPoolResource, r.isStaffResource, r.isAgencyResource, r.isOverTimeCondition, r.pay_specialty_rate, r.overTimeHours, t.shift_type_ind, t.max_wkly_hours, t.number_of_weeks, DATE_FORMAT(x.shift_begin_date, '%m/%d/%y %H:%i') as begin_date_string, DATE_FORMAT(x.shift_end_date, '%m/%d/%y %H:%i') as end_date_string, DATE_FORMAT(x.staff_release_date, '%m/%d/%y %H:%i') as staff_date_string, DATE_FORMAT(x.agency_release_date, '%m/%d/%y %H:%i') as agency_date_string, DATE_FORMAT(x.created_date, '%m/%d/%Y %H:%i') as created_date_string, DATE_FORMAT(x.lastmodified_date, '%m/%d/%Y %H:%i') as lastmod_date_string FROM ShiftRequests r, Shifts x, ShiftTypeDetail t , ShiftRequestStatus z, Users u, Facilities f, Departments d, UserTypes ut WHERE r.shift_id = x.shift_id AND r.shift_id=260 AND r.user_id=u.user_id AND x.shift_status_id < 9 AND r.request_status_id != 30 AND r.request_status_id = z.shift_status_id AND t.shift_id=x.shift_id AND f.facility_id = x.facility_id AND d.department_id = x.department_id AND ut.user_type_id = x.user_type_id ORDER by r.request_status_id ASC, r.request_priority ASC, r.isOverTimeCondition ASC, r.overTimeHours ASC
      14:47:55,511 ERROR [STDERR] javax.transaction.TransactionRolledbackException: Application deadlock detected: Two or more transactions contention.; nested exception is:
      org.jboss.ejb.plugins.lock.ApplicationDeadlockException: Application deadlock detected: Two or more transactions contention.
      14:47:55,513 ERROR [STDERR] org.jboss.ejb.plugins.lock.ApplicationDeadlockException: Application deadlock detected: Two or more transactions contention.
      14:47:55,515 ERROR [STDERR] at org.jboss.ejb.plugins.lock.BeanLockSupport.deadlockDetection(BeanLockSupport.java:136)
      14:47:55,518 ERROR [STDERR] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.waitForTx(QueuedPessimisticEJBLock.java:263)
      14:47:55,520 ERROR [STDERR] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.doSchedule(QueuedPessimisticEJBLock.java:196)
      14:47:55,522 ERROR [STDERR] at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.schedule(QueuedPessimisticEJBLock.java:143)
      14:47:55,524 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:103)
      14:47:55,526 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      14:47:55,529 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      14:47:55,531 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      14:47:55,533 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      14:47:55,535 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      14:47:55,537 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      14:47:55,539 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      14:47:55,541 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:712)
      14:47:55,543 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      14:47:55,545 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      14:47:55,547 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      14:47:55,549 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      14:47:55,551 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      14:47:55,553 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      14:47:55,555 ERROR [STDERR] at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
      14:47:55,557 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      14:47:55,559 ERROR [STDERR] at $Proxy108.getApprovedAgencyModel(Unknown Source)
      14:47:55,561 ERROR [STDERR] at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getOpenShiftRequestsList(Unknown Source)
      14:47:55,563 ERROR [STDERR] at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getShiftAllOpenRequests(Unknown Source)
      14:47:55,566 ERROR [STDERR] at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getFacilityOpenShifts(Unknown Source)
      14:47:55,568 ERROR [STDERR] at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getFacilityOpenShiftsList(Unknown Source)
      14:47:55,570 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:47:55,572 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      14:47:55,574 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      14:47:55,667 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      14:47:55,669 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      14:47:55,671 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      14:47:55,674 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      14:47:55,676 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      14:47:55,678 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
      14:47:55,680 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      14:47:55,682 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:712)
      14:47:55,684 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      14:47:55,686 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      14:47:55,688 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      14:47:55,690 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      14:47:55,692 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      14:47:55,695 ERROR [STDERR] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      14:47:55,697 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      14:47:55,699 ERROR [STDERR] at $Proxy71.getFacilityOpenShiftsList(Unknown Source)
      14:47:55,701 ERROR [STDERR] at com.icshealth.web.servlet.MenuServlet.getFacilityMenuModels(Unknown Source)
      14:47:55,703 ERROR [STDERR] at com.icshealth.web.servlet.MenuServlet.doMainMenu(Unknown Source)
      14:47:55,705 ERROR [STDERR] at com.icshealth.web.servlet.MenuServlet.handleRequest(Unknown Source)
      14:47:55,707 ERROR [STDERR] at com.icshealth.web.servlet.AbstractController.checkSessionAuthentication(Unknown Source)
      14:47:55,709 ERROR [STDERR] at com.icshealth.web.servlet.AbstractController.doGet(Unknown Source)
      14:47:55,711 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      14:47:55,713 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      14:47:55,715 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
      14:47:55,717 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:284)
      14:47:55,719 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:577)
      14:47:55,721 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1674)
      14:47:55,723 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      14:47:55,726 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1624)
      14:47:55,728 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      14:47:55,730 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:541)
      14:47:55,732 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:785)
      14:47:55,734 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:935)
      14:47:55,737 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:802)
      14:47:55,739 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:200)
      14:47:55,741 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:294)
      14:47:55,743 ERROR [STDERR] at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:743)
      14:47:55,745 ERROR [STDERR] at java.lang.Thread.run(Thread.java:491)
      14:47:55,751 INFO [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.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:549)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:665)
      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.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)
      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.Container.invoke(Container.java:730)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      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.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy64.findAllRequestsForShift(Unknown Source)
      at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getShiftRequestCount(Unknown Source)
      at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getFacilityOpenShifts(Unknown Source)
      at com.icshealth.ejb.session.ICSRegSQLFinderUtilsEJB.getFacilityOpenShiftsList(Unknown Source)
      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 $Proxy71.getFacilityOpenShiftsList(Unknown Source)
      at com.icshealth.web.servlet.MenuServlet.getFacilityMenuModels(Unknown Source)
      at com.icshealth.web.servlet.MenuServlet.doMainMenu(Unknown Source)
      at com.icshealth.web.servlet.MenuServlet.handleRequest(Unknown Source)
      at com.icshealth.web.servlet.AbstractController.checkSessionAuthentication(Unknown Source)
      at com.icshealth.web.servlet.AbstractController.doGet(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:366)
      at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:284)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:577)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1674)
      at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:544)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1624)
      at org.mortbay.http.HttpServer.service(HttpServer.java:875)
      at org.jboss.jetty.Jetty.service(Jetty.java:541)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:785)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:935)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:802)
      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:743)
      at java.lang.Thread.run(Thread.java:491)
      14:47:55,945 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.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.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:549)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:323)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:665)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)