I have an MDB in WebSphere 6. The MessageListener is linked to a Tibco EMS queue. In the MDB I'm trying to write to a WebSphere MQ queue. I get the following error:
WMSG0042I: MDB Listener LoanIQ Payments Inbound started successfully for JMSDestination jms/eid/payments
WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.
WTRN0086I: XAException encountered during prepare phase for transaction 00000131...0001. Local resources follow.
WTRN0089I: XATransactionWrapper@ 3fbe3fbe XAResource: com.ibm.ejs.jms.JMSManagedSession$JMSXAResource@3fb83fb8 enlisted: true mcWrapper.hashCode()1038237154: Vote: commit.
WTRN0089I: LocalTransactionWrapper@:4e2e4e2e LocalTransaction:com.ibm.ejs.jms.JMSManagedSession$JMS LocalTransaction@4e5a4e5a enlisted:true registeredForSynctruemcWrapper.hashcode()1032076676: Vote: none.
The QueueConnectionFactory instance is a com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle
. Could I get an XAConnection from this? Do I need to? I'd prefer to stay with vanilla JMS if possible.
The MDB implementation is akin to:
public void onMessage(Message message) {
// ^^ incoming message delivered from EMS queue via WAS MessageListener
TextMessage textMessage = (TextMessage) message;
QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(factoryName);
Queue queue = (Queue) context.lookup(queueName);
QueueConnection connection = factory.createQueueConnection();
connection.start();
QueueSession session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
TextMessage message = session.createTextMessage("some new payload");
sender.send(message);
// ^^ outgoing message sent to WebSphere MQ queue
}