I am working on a MuleESB project where I receive messages from an ActiveMQ which contain pictures encoded in Base64, when I'm done processing the message I try to send it to another queue, but then I get the following error. Does anyone have any idea of why this exceptions happens:
ERROR 2016-03-11 14:00:24,168 [Active_MQ.scheduler.04] org.mule.exception.CatchMessagingExceptionStrategy: ******************************************************************************** Message : transaction has been marked as rollback only (bitronix.tm.internal.BitronixRollbackException) Type
: org.mule.api.transaction.TransactionException Code
: MULE_ERROR--2 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transaction/TransactionException.html ******************************************************************************** Exception stack is: 1. transaction has been marked as rollback only (bitronix.tm.internal.BitronixRollbackException)
bitronix.tm.BitronixTransaction:116 (null) 2. transaction has been marked as rollback only (bitronix.tm.internal.BitronixRollbackException) (org.mule.api.transaction.TransactionException)
org.mule.transaction.XaTransaction:315 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transaction/TransactionException.html) ******************************************************************************** Root Exception stack trace: bitronix.tm.internal.BitronixRollbackException: transaction has been marked as rollback only at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:116) at com.mulesoft.mule.bti.transaction.TransactionWrapper.enlistResource(TransactionWrapper.java:53) at org.mule.transaction.XaTransaction.enlistResource(XaTransaction.java:311) at com.mulesoft.mule.bti.jms.BitronixSessionInvocationHandler.enlist(BitronixSessionInvocationHandler.java:110) at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.mulesoft.mule.bti.jms.BitronixSessionInvocationHandler.invoke(BitronixSessionInvocationHandler.java:54) at com.sun.proxy.$Proxy116.enlist(Unknown Source) at org.mule.transaction.XaTransaction.bindResource(XaTransaction.java:287) at org.mule.transport.AbstractConnector.getTransactionalResource(AbstractConnector.java:2041) at org.mule.transport.jms.transformers.AbstractJmsTransformer.getSession(AbstractJmsTransformer.java:199) at org.mule.transport.jms.transformers.AbstractJmsTransformer.transformToMessage(AbstractJmsTransformer.java:65) at org.mule.transport.jms.transformers.ObjectToJMSMessage.transformMessage(ObjectToJMSMessage.java:54) at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:141) at org.mule.transformer.AbstractMessageTransformer.transform(AbstractMessageTransformer.java:89) at org.mule.DefaultMuleMessage.transformMessage(DefaultMuleMessage.java:1602) at org.mule.DefaultMuleMessage.applyAllTransformers(DefaultMuleMessage.java:1509) at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1487) at org.mule.DefaultMuleMessage.applyTransformers(DefaultMuleMessage.java:1470) at org.mule.transport.AbstractMessageDispatcher.applyOutboundTransformers(AbstractMessageDispatcher.java:205) at org.mule.transport.jms.JmsMessageDispatcher.applyOutboundTransformers(JmsMessageDispatcher.java:506) at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:71) at org.mule.transport.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2662) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:102) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:94) at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:56) at org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor.process(OutboundResponsePropertiesMessageProcessor.java:35) at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24) at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.ja...
I am assuming that your message processing was successful (it did not throw any exceptions). So, one potential reason could be that the transaction is timing out. I would suggest you to enable bitronix transaction logs (probably by reducing the concurrent receiver count of inbound queue to one so that your logs will be less cluttered).
Also, please answer the following questions:
1 . This exceptions occurs for all messages? or it is intermittent? 2 . How long it takes to process the inbound message? 3 . What is your transaction timeout? 4 . Which version of Mule are you using?
I am asking this because I have faced something very similar and found the root cause. If I could get answers for above questions, I can be more specific in further updates.
Update:
Highly likely that this could be the root cause. Have a look.
https://www.mulesoft.org/jira/browse/MULE-8964
Update
If your license is EE, fix for the issue is available in v3.7.3 . This is what they have added to fix the issue.
https://github.com/mulesoft/mule/commit/1b1bfafda3e8dc16b596a150fc2a8b518382cd20#diff-1
Here is the summary of the issue:
Mule polls for JMS messages with a polling timeout same as the configured xa transaction timeout (default:60 Secs). So, the polling thread waits a maximum of 60 seconds for a message to arrive in the queue. XA trnsaction begins the moment polling starts. Consider a scenario where the polling thread receives the message very close to the polling timeout ; say at 59th second (XA Transaction is close to timeout here because it began when polling was initiated) . If message processing takes another 5 seconds, total time of the XA Transaction will be 64 seconds (59 +5). Before the processing finishes, transaction manager kills the transaction because it exceeded the XA timeout.