users@glassfish.java.net

JTS5041: The resource manager is doing work outside a global transaction

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 Jul 2008 10:07:34 PDT

I'm running GlassFish V2 and our deployment environment is :
SunOS 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V240

We have deployed our EAR file to the server, which is clustered. Now when we perform certain actions we receive the exceptions listed below. Basically,

[b]JTS5041: The resource manager is doing work outside a global transaction[/b]

Our Stateless EJB has the following annotations defining it as an EJB and the transaction boundary.
@Stateless(name = "QuoteBroker")
@Local(com.sybase.it.quoting.QuoteBroker.class)
@Interceptors(SpringBeanAutowiringInterceptor.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)

Looking at the Exception message it appears as if the container is not starting a transaction when the methods are invoked. How is this possible and how do we get around this issue?

Thanks for the help...

[u][b]Stack Trace:[/b][/u]
[#|2008-07-28T09:11:22.174-0700|WARNING|sun-appserver9.1|javax.enterprise.system.core.transaction|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;_RequestID=b7e375b0-c20e-4634-ab69-d95026a47426;|JTS5041: The resource manager is doing work outside a global transaction
javax.transaction.xa.XAException
        at com.sybase.jdbc3.jdbc.SybXAResource.a(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybXAResource.a(Unknown Source)
        at com.sybase.jdbc3.jdbc.SybXAResource.start(Unknown Source)
        at com.sun.gjc.spi.XAResourceImpl.start(XAResourceImpl.java:222)
        at com.sun.jts.jta.TransactionState.startAssociation(TransactionState.java:305)
        at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:205)
        at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:562)
        at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:372)
        at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:144)
        at com.sun.enterprise.resource.SystemResourceManagerImpl.enlistResource(SystemResourceManagerImpl.java:98)
        at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:216)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:337)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
        at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)
        at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:108)
        at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
        at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:210)
        at $Proxy134.prepareStatement(Unknown Source


[u][b]More:[/b][/u]

[#|2008-07-28T09:11:22.199-0700|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;_RequestID=b7e375b0-c20e-4634-ab69-d95026a47426;|poolmgr.err_enlisting_res_in_getconn|#]

[#|2008-07-28T09:11:22.202-0700|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;cosmosConnectionPool;javax.transaction.SystemException;_RequestID=b7e375b0-c20e-4634-ab69-d95026a47426;|RAR5117 : Failed to obtain/create connection from connection pool [ cosmosConnectionPool ]. Reason : javax.transaction.SystemException|#]

[#|2008-07-28T09:11:22.203-0700|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;Error in allocating a connection. Cause: javax.transaction.SystemException;_RequestID=b7e375b0-c20e-4634-ab69-d95026a47426;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: javax.transaction.SystemException]|#]

[#|2008-07-28T09:11:22.205-0700|INFO|sun-appserver9.1|com.sybase.it.quoting.advice.MethodTimingInterceptor|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;|Method Invocation Complete [com.sybase.it.quoting.dao.ibatis.CosmosDaoImpl.validateCBS] Total Time: 0(seconds) 37(millis)|#]

[#|2008-07-28T09:11:22.206-0700|SEVERE|sun-appserver9.1|com.sybase.it.customer.impl.CustomerBroker|_ThreadID=22;_ThreadName=httpSSLWorkerThread-1080-0;_RequestID=b7e375b0-c20e-4634-ab69-d95026a47426;|org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in com/sybase/it/quoting/dao/ibatis/maps/Cosmos.xml.
--- The error occurred while executing query.
--- Check the SELECT CASE WHEN COUNT(1) = 0 THEN 'N' ELSE 'Y' END FROM ciim..customer_shipping JOIN ciim..customer_billing ON ciim..customer_shipping.customer_no = ciim..customer_billing.customer_no AND ciim..customer_shipping.bill_to_location = ciim..customer_billing.bill_to_location JOIN sybasedb..customers ON ciim..customer_shipping.customer_no = sybasedb..customers.customer_no where (sybasedb..customers.activeind = 'Y' OR sybasedb..customers.activeind = 'y') and ciim..customer_shipping.customer_no = ? and ciim..customer_shipping.addr_status = 'ACT' and ciim..customer_shipping.ship_to_location = ? and ciim..customer_shipping.bill_to_location = ? .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/sybase/it/quoting/dao/ibatis/maps/Cosmos.xml.
--- The error occurred while executing query.
--- Check the SELECT CASE WHEN COUNT(1) = 0 THEN 'N' ELSE 'Y' END FROM ciim..customer_shipping JOIN ciim..customer_billing ON ciim..customer_shipping.customer_no = ciim..customer_billing.customer_no AND ciim..customer_shipping.bill_to_location = ciim..customer_billing.bill_to_location JOIN sybasedb..customers ON ciim..customer_shipping.customer_no = sybasedb..customers.customer_no where (sybasedb..customers.activeind = 'Y' OR sybasedb..customers.activeind = 'y') and ciim..customer_shipping.customer_no = ? and ciim..customer_shipping.addr_status = 'ACT' and ciim..customer_shipping.ship_to_location = ? and ciim..customer_shipping.bill_to_location = ? .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException|#
[Message sent by forum member 'cmathrusse' (cmathrusse)]

http://forums.java.net/jive/thread.jspa?messageID=289834