Announcement Announcement Module
No announcement yet.
Transaction Rolled Back with spring and OpenMq exception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transaction Rolled Back with spring and OpenMq exception

    Hi Spring Experts,

    I am integrating openMQ with spring JMS support and getting exception during transaction with Broker. I am having some questions regarding this.

    1- I am using asynchronous messaging with MDP with 2 queues success and error queue. While the message is fine its storing into DB after processing message from broker. If there is any error while saving message into DB i am redirecting that error message to error queue. But during this operation i am getting always an exception for transaction if added an transaction manager in jms-listener-container and not if removed no exception but i want to use Transaction Manager. is it possible or should i remove Transaction Manager. Below is stack trace of exception

    2- also let me know if i am configuring acknowledge from xml is this needed to acknowledge with message.acknowledge() in code.What will be behavior of DefaultMessageListenerContainer if we send acknowledge with code after persisting message into DB(my flow of message: message->BrokerOpenMQ->DB) while asynchronous sending. Will default message container put consumer thread as wait?

    com.sun.messaging.jms.JMSException: [END_TRANSACTION_REPLY(59)] [C4036]: A broker error occurred. :[500] Cannot perform operation END_TRANSACTION(58) (XAFlag=0x4000000:TMSUCCESS) for the transaction has been set to FAILED from STARTED(1) user=guest, broker=localhost:7676(3193)
    	at com.sun.messaging.jmq.jmsclient.ProtocolHandler.throwServerErrorException(
    	at com.sun.messaging.jmq.jmsclient.ProtocolHandler.endTransaction(
    	at com.sun.messaging.jmq.jmsclient.Transaction.endXATransaction(
    	at com.sun.messaging.jmq.jmsclient.XAResourceImpl.end(
    	at org.objectweb.jotm.TransactionImpl.delistResource(
    	at org.objectweb.jotm.TransactionImpl.doDetach(
    	at org.objectweb.jotm.SubCoordinator.rollback(
    	at org.objectweb.jotm.TransactionImpl.rollback(
    	at org.objectweb.jotm.Current.rollback(
    	at org.springframework.transaction.jta.JtaTransactionManager.doRollback(
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.rollbackOnException(
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$
    any advice is appreciated.
    Last edited by Akhtar; Jul 28th, 2009, 01:57 AM.