Atomikos Forum

XATransactionResource already closed

Configuration:
Tomcat 6
Atomikos 3.7.0 installed on J2EE level (in Tomcat6/lib)

After hot deploying our WAR file, we consistently get this error:

java.lang.IllegalStateException: XATransactionResource already closed
    at com.atomikos.datasource.xa.XATransactionalResource.getResourceTransaction(XATransactionalResource.java:400)
    at com.atomikos.datasource.xa.session.BranchEnlistedStateHandler.<init>(BranchEnlistedStateHandler.java:54)
    at com.atomikos.datasource.xa.session.NotInBranchStateHandler.checkEnlistBeforeUse(NotInBranchStateHandler.java:66)
    at com.atomikos.datasource.xa.session.TransactionContext.checkEnlistBeforeUse(TransactionContext.java:85)
    at com.atomikos.datasource.xa.session.SessionHandleState.notifyBeforeUse(SessionHandleState.java:176)
    at com.atomikos.jdbc.AtomikosConnectionProxy.enlist(AtomikosConnectionProxy.java:204)
    at com.atomikos.jdbc.AtomikosConnectionProxy.invoke(AtomikosConnectionProxy.java:138)
    at $Proxy159.prepareCall(Unknown Source)
    at org.springframework.jdbc.core.CallableStatementCreatorFactory$CallableStatementCreatorImpl.createCallableStatement(CallableStatementCreatorFactory.java:167)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:930)
    at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985)
    at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:117)

Stopping and restarting Tomcat solves this problem.

Any idea what is wrong?
Rik Gruwez (2) Send private email
Monday, July 04, 2011
 
 
Only some guesses - you did not provide much information about your XAResource:

Where is your XAResource (i guess a datasource) configured?
I you do it via spring make sure you configured init-method and destroy-method on the DataSource Beans to close + start the Resource on spring context startup/shutdown.

If done via JNDI you are stuck with Tomcat6 - tomcat7 does provide some hooks to call a destroy on a jndi resource, tomcat6 does not have this ability afaik.
Torsten Krah Send private email
Saturday, July 09, 2011
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics