Trying to rollback an XA transaction against WebSphere MQ resource results in errorCode '100'.
Issue
Running a Camel route that consumes from WebSphere MQ Series and produces to ActiveMQ using XA transactions.
Here is a sample route definition
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="wmq-to-amq">
<from uri="wmqxa:IN" />
<transacted ref="requiredJta" />
<log message="REDELIVERED: ${header.JMSRedelivered}" />
<to uri="amqxa:queue:OUT" />
<process ref="testProcessor" />
</route>
</camelContext>
If the Camel route raises an exception during the routing, the transaction correctly gets marked for rollback.
On rolling back the transaction on WebSphere MQ Series it raises the following error:
13:50:21,203 | TRACE | umer[tmielke.in] | WrapperNamedXAResource | 123 -
org.apache.aries.transaction.manager - 1.0.1.redhat-60024 | End called on XAResource ibm-wmq
Xid: [Xid:globalId=ffffff83ffffffd5ffffff8151421006f72672e6170616368652e61726965732e7472616e73616374696f6e00000000
00000000000000000000,length=64,branchId=200050ffffffd5ffffff8151421006170616368652e61726965732e7472616e736163
74696f6e0000000000000000000000000000,length=64]
flags: TMFAIL remaining: 536870912
13:50:21,373 | WARN | umer[tmielke.in] | Transaction | 123 -
org.apache.aries.transaction.manager - 1.0.1.redhat-60024 | Error ending association for XAResource
org.apache.geronimo.transaction.manager.WrapperNamedXAResource@4c88efc4; transaction will roll back. XA error code: 100
javax.transaction.xa.XAException: The method 'xa_end' has failed with errorCode '100'.
at com.ibm.mq.jmqi.JmqiXAResource.end(JmqiXAResource.java:541)[271:com.ibm.msg.client.osgi.wmq:7.5.0.2]
at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.end(WrapperNamedXAResource.java:61)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:578)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:557)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:490)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:265)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1037)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:845)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:706)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.apache.aries.transaction.GeronimoPlatformTransactionManager.commit(GeronimoPlatformTransactionManager.java:76)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at Proxyae3fb507_4439_4ed0_a216_45d404c72c69.commit(Unknown Source)[:]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:258)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1063)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:960)[175:org.springframework.jms:3.1.3.RELEASE]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)[:1.6.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)[:1.6.0_65]
at java.lang.Thread.run(Thread.java:695)[:1.6.0_65]
13:50:21,544 | ERROR | umer[tmielke.in] | RollbackTask | 123 -
org.apache.aries.transaction.manager - 1.0.1.redhat-60024 | Unexpected exception committing
org.apache.geronimo.transaction.manager.WrapperNamedXAResource@4c88efc4; continuing to commit other RMs
javax.transaction.xa.XAException: The method 'xa_rollback' has failed with errorCode '-4'.
at com.ibm.mq.jmqi.JmqiXAResource.rollback(JmqiXAResource.java:861)[271:com.ibm.msg.client.osgi.wmq:7.5.0.2]
at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:100)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.RollbackTask.run(RollbackTask.java:64)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResources(TransactionImpl.java:594)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:493)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:265)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1037)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:845)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:706)[136:org.springframework.transaction:3.1.3.RELEASE]
at org.apache.aries.transaction.GeronimoPlatformTransactionManager.commit(GeronimoPlatformTransactionManager.java:76)[123:org.apache.aries.transaction.manager:1.0.1.redhat-60024]
at Proxyae3fb507_4439_4ed0_a216_45d404c72c69.commit(Unknown Source)[:]
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:258)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1071)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1063)[175:org.springframework.jms:3.1.3.RELEASE]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:960)[175:org.springframework.jms:3.1.3.RELEASE]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)[:1.6.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)[:1.6.0_65]
at java.lang.Thread.run(Thread.java:695)[:1.6.0_65]
The first trace message above would only be logged if trace level logging was enabled for package org.apache.aries.transaction.manager.
Environment
- JBoss Fuse 6.0
- WebSphere MQ Series 7.5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.