2 Replies Latest reply on Oct 4, 2010 10:53 PM by jessica leahy

    Transaction including several components by the use of servicemix-eip

    andreas lodde Newbie

      Hello everybody,

       

      I am trying to establish a transaction above several components using servicemix-eip. My testing workflow looks like.

       

      JCA-Consumer -> pipeline -> bean with database access -> Jms-Provider

       

      The Transaction works fine if the JCA-Consumer calls the bean which access the database directly (bean set ExchangeStatus to DONE before replying).

       

      Also the workflow works fine as long I do not set autoEnlistInTransaction="true". In this case I always get the following Exception after the bean has processed the messageExchnage and passed to the Jms-Provider. For me this looks like the Jms-Provider starts it now transaction and do not resume the transaction which has been started by the jca-consumer and is used by the bean.

       

      Would be great if somebody could give me an advice what I have to do to solve this problem.

       

      Thanks a lot,

       

      Best regards Andreas

       

      javax.jbi.messaging.MessagingException: java.lang.IllegalStateException: the transaction context set

      in the messageExchange is not bound to the current thread

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.autoEnlistInTx(DeliveryChannelImpl.java:809)

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:368)

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:441)

      at org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:89)

      at org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:70)

      at org.apache.servicemix.common.endpoints.SimpleEndpoint.done(SimpleEndpoint.java:85)

      at org.apache.servicemix.eip.patterns.Pipeline.processAsyncTargetResponse(Pipeline.java:474)

       

      at org.apache.servicemix.eip.patterns.Pipeline.processAsync(Pipeline.java:331)

      at org.apache.servicemix.eip.EIPEndpoint.process(EIPEndpoint.java:185)

      at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)

      at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598)

      at org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)

      at org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:632)

      at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:185)

      at org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow.onMessage(JCAFlow.java:582)

      at org.jencks.XAEndpoint.onMessage(XAEndpoint.java:129)

      at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)

      at org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)

      at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:770)

      at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

      at java.lang.Thread.run(Thread.java:595)

      Caused by: java.lang.IllegalStateException: the transaction context set in the messageExchange is no

      t bound to the current thread

      at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.autoEnlistInTx(DeliveryChannelImpl.java:804)