try
{
conn1 = cf.createXAConnection();
XASession sess1 = conn1.createXASession();
XAResource res1 = sess1.getXAResource();
byte[] branchQualifier = new byte[] { 1, 2, 3, 4, 5, 6, 0, 0, 0, 0 };
byte[] globalTxId = new byte[] { 6, 5, 4, 3, 2, 1, 0, 0, 0, 0 };
Xid trailing = new MessagingXid(branchQualifier, 12435, globalTxId);
res1.start(trailing, XAResource.TMNOFLAGS);
MessageProducer prod1 = sess1.createProducer(queue);
TextMessage tm1 = sess1.createTextMessage("testing1");
prod1.send(tm1);
res1.end(trailing, XAResource.TMSUCCESS);