Sun Java Application Server Throws Oracle XA Exception: "The resource manager is doing work outside a global transaction" (Doc ID 1008819.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 7.1 and later
All Platforms


Symptoms

Description

This document details the most probable cause and solution for seeing the following message in a Sun Java Application Server instance's server.log file when trying to utilize a Connection Pool with Global/XA Transactions enabled against an Oracle Database:

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

 

Steps to Follow

The following shows the relevant sections of the exception stack traces that are seen in the instance's logfiles when this problem occurs. Note that the application-specific portions of the stack traces have been removed to improve clarity.

WARNING: JTS5041: The resource manager is doing work outside a global transaction
javax.transaction.xa.XAException
at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:146)
at com.sun.jts.jta.TransactionState.startAssociation(Unknown Source)
at com.sun.jts.jta.TransactionImpl.enlistResource(Unknown Source)
at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(Unknown Source)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(Unknown Source)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(Unknown Source)
at com.sun.enterprise.resource.PoolManagerImpl.registerResource(UnknownSource)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(Unknown Source)
at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(Unknown Source)
at com.sun.enterprise.resource.JdbcDataSource.getConnection(Unknown Source)
at samples.transactions.ejb.cmt.simple.util.LocalBankAccount.getDBConnection(Unknown Source)


The exception stack trace shows that the application was attempting to get a database connection from the connection pool. The connection pool did obtain a connection but then encountered a problem registering the connection with this transaction manager to enlist it in a global transaction.

The XAException is then followed by the following javax.transaction.SystemException:

SEVERE: RAR5029:Unexpected exception while registering component javax.transaction.SystemException
at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:177)
at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:310)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.
java:285)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.
java:108)
at com.sun.enterprise.resource.PoolManagerImpl.registerResource(PoolManagerImpl.java:196)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:172)
at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:241)
at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:124)


Which in turn is followed by this javax.transaction.SystemException:

SEVERE: RAR5041:Cannot get jdbc connection
javax.transaction.SystemException
at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:177)
at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:310)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:285)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:108)
at com.sun.enterprise.resource.PoolManagerImpl.registerResource(PoolManagerImpl.java:196)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:172)
at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:241)
at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:124)


Both of these exceptions indicate the same problem, that is was not possible to include the connection in a global transaction.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms