Announcement Announcement Module
Collapse
No announcement yet.
Transaction Rolled Back with spring and OpenMq exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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?


    Code:
    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(ProtocolHandler.java:3982)
    	at com.sun.messaging.jmq.jmsclient.ProtocolHandler.endTransaction(ProtocolHandler.java:2811)
    	at com.sun.messaging.jmq.jmsclient.Transaction.endXATransaction(Transaction.java:568)
    	at com.sun.messaging.jmq.jmsclient.XAResourceImpl.end(XAResourceImpl.java:259)
    	at org.objectweb.jotm.TransactionImpl.delistResource(TransactionImpl.java:324)
    	at org.objectweb.jotm.TransactionImpl.doDetach(TransactionImpl.java:502)
    	at org.objectweb.jotm.SubCoordinator.rollback(SubCoordinator.java:292)
    	at org.objectweb.jotm.TransactionImpl.rollback(TransactionImpl.java:668)
    	at org.objectweb.jotm.Current.rollback(Current.java:538)
    	at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1054)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)
    	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.rollbackOnException(AbstractPollingMessageListenerContainer.java:385)
    	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
    	at java.lang.Thread.run(Thread.java:619)
    any advice is appreciated.
    Last edited by Akhtar; Jul 28th, 2009, 02:57 AM.
Working...
X