I have a servlet in which I need to post some messages to a queue over an XA connection and some message over a non-XA connection. I have setup a JmsNonXa connection in jms-ds. I access both jms resources through the web.xml resource-ref and corresponding jboss-web.xml. I get a handle to UserTransaction, call begin() do work, and finally call commit(). When I do this I get an exception:
10:58:23,062 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=LITLT0067399/28, BranchQual=,
localId=28] errorCode=XAER_PROTO
org.jboss.resource.connectionmanager.JBossLocalXAException: wrong xid in rollback: expected: null, got: XidImpl[FormatId=257, Glob
alId=LITLT0067399/28, BranchQual=2, localId=28]
and the message posted through the XA connection get rolled back. What is the pattern here for working with XA and local (nonXA) resources? It is really not possible to re-factor the interaction to these resources into layers where the local-jms resource is not used within a userTransaction. Any ideas would be appreciated.
Thanks.