Hello everybody,

I am trying to setup a transaction above several servicemix components
(servicemix-jms, servicemix-eip and servicemix-bean). 

The desired workflow looks like:

Jca-consumer ->   bean1 -> bean2 -> Jms-provider.

My Jms configuration:

<jms:provider service="ce:JmsProvider"
                endpoint="JmsProviderEnpoint"
                destinationName="my.queue2"
                connectionFactory="#xaConnectionFactory"/>
         
<jms:jca-consumer service="ce:JmsConsumer"
                    endpoint="JmsConsumerEndpoint"
                    connectionFactory="#xaConnectionFactory"
                    targetService="ce:pipeline"
                    targetEndpoint="piplineEndpoint"
                    targetOperation="executeReport"
                    resourceAdapter="#ra"
                    synchronous="false"
                    activationSpec="#as"/>

And my EIP configuration:

<eip:pipeline service="ce:pipeline" endpoint="pipelineEndpoint" >
  <eip:transformer>
        <eip:exchange-target service="ce:routingSlip" 
endpoint="beanendpoints"/>  
  </eip:transformer>
  <eip:target>
    <eip:exchange-target service="ce:JmsProvider"
endpoint="JmsProviderEnpoint"/>
  </eip:target>
</eip:pipeline>

<eip:static-routing-slip service="ce:routingSlip" endpoint="beanendpoints" >
  <eip:targets>
    <eip:exchange-target service="ce:bean" endpoint="beanendpoint"/>
    <eip:exchange-target service="ce:bean" endpoint="beanendpointOracle"/>
  </eip:targets>
</eip:static-routing-slip>

Within the bean classes I am enlisting mysql and oracle xaresources to the
transaction. After performing  operations on both databases I delist both
resources.

Every think works fine until the MessageExchange is forwarded to the
JmsProvider.
I also get the following Exception if I am processing a request.

org.apache.geronimo.transaction.manager.transactioni...@1c6fed0
ERROR - EIPComponent                   - Error processing exchange InOut[
  id: ID:10.20.1.42-128b5c78570-3:11
  status: Active
  role: consumer
  service: {http://www.lippmann.lu/integra}bean
  endpoint: beanendpointOracle
  in: <?xml version="1.0" encoding="UTF-8"?>…
  out: <?xml version="1.0" encoding="UTF-8"?>…
]
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.eip.patterns.StaticRoutingSlip.processConsumerAsync(StaticRoutingSlip.java:221)
        at
org.apache.servicemix.eip.patterns.StaticRoutingSlip.processAsync(StaticRoutingSlip.java:145)
        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 not bound to the current thread
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.autoEnlistInTx(DeliveryChannelImpl.java:804)

-- 
View this message in context: 
http://old.nabble.com/servicemix-3.3.2-transaction-problems-tp28621084p28621084.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to