You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by Ioannis Canellos <io...@gmail.com> on 2011/01/26 09:43:34 UTC

The transaction context set in the messageExchange is not bound to the current thread

Hi all,

I am having this error whenever I use a jms endpoint acting as a consumer
that has as targetService a provider (e.g. http provider endpoint or
implementations of SimpleEndpoint).
If I put between these two any other endpoint (e.g. an eip wiretap or a
pipeline) everything works fine.


The detailed error message is:
*Error while handling response:javax.jbi.messaging.MessagingException:
java.lang.IllegalStateException: the transaction context set in the
messageExchange is not bound to the current thread*


-- 
*Ioannis Canellos*
http://iocanel.blogspot.com

Integration Engineer @ Upstream S.A. <http://www.upstreamsystems.com>

Re: The transaction context set in the messageExchange is not bound to the current thread

Posted by Ioannis Canellos <io...@gmail.com>.
Hi Jean Baptiste!


Here is the xbean of my jms endpoint. Note that this xbean is deployed on
smx 3.x war distribution on jboss as 4.x. ActiveMQ is deployed as ra on
jboss and ServiceMix retrieves the connection factory via jndi.


<?xml version=*"1.0"* encoding=*"UTF-8"*?>



<beans xmlns=*"http://www.springframework.org/schema/beans"*

       xmlns:jms=*"http://servicemix.apache.org/jms/1.0"*

       xmlns:sns=*"http://<http://curry.upstreamsystems.com/timitaly/service/mt>
net.iocanel.test/1.0"*

       xmlns:jee=*"http://www.springframework.org/schema/jee"*

       xmlns:util=*"http://www.springframework.org/schema/util"*

       xmlns:xsi=*"http://http://www.w3.org/2001/XMLSchema-instance"*

       xmlns:amqpool=*"http://jencks.org/amqpool/2.0"*

       xmlns:amqra=*"http://activemq.apache.org/schema/ra"*

       xmlns:amq=*"http://activemq.apache.org/schema/core"*

       xmlns:aop=*"http://www.springframework.org/schema/aop"*

       xmlns:tx=*"http://www.springframework.org/schema/tx"*

       xsi:schemaLocation=*"http://servicemix.apache.org/jms/1.0
http://servicemix.apache.org/schema/servicemix-jms-3.3.xsd*

*       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd*

*       http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.5.xsd*

*       http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"*>



    <aop:aspectj-autoproxy proxy-target-class=*"true"*/>


    <!-- JMS Consumers -->

    <

<jms:endpoint

            id=*"jms-consumer"*

            service=*"sns:jms-consumer"*

            endpoint=*"jmsMonitoredEndpoint"*

            targetService=*"sns:http-provider"*

            role=*"consumer"*

            processorName=*"jca"*

            defaultMep=*"http://www.w3.org/2004/08/wsdl/in-only"*

            connectionFactory=*"#XAConnectionFactory"*

            synchronous=*"true"*

            resourceAdapter=*"#amqResourceAdapter"*

            bootstrapContext=*"#bootstrapContext"*

            rollbackOnError=*"true"*>

        <jms:activationSpec>

            <amqra:activationSpec maxSessions=*"30"* destination=*
"msg.outbound"* destinationType=*"javax.jms.Queue"*

                                  maximumRedeliveries=*"3"*
maxMessagesPerSessions=*"1"* initialRedeliveryDelay=*"30000"*
useExponentialBackOff=*"true"*/>

        </jms:activationSpec>

    </jms:endpoint>


    <jee:jndi-lookup id=*"XAConnectionFactory"* jndi-name=*
"activemq/ConnectionFactory"*/>

    <jee:jndi-lookup id=*"bootstrapContext"* jndi-name=*
"smx/BootstrapContext"* environment-ref=*"springJndiEnv"*/>

    <jee:jndi-lookup id=*"amqResourceAdapter"* jndi-name=*
"activemq/ResourceAdapter"* environment-ref=*"springJndiEnv"*/>



    <util:properties id=*"springJndiEnv"*>

        <prop key=*"java.naming.factory.initial"*>
org.apache.xbean.spring.jndi.SpringInitialContextFactory</prop>

    </util:properties>


</beans>

Re: The transaction context set in the messageExchange is not bound to the current thread

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Ioannis,

could you paste your xbean.xml describing tour JMS consumer ?
Especially, which MEP do you use with which transaction context ?

Regards
JB

On 01/26/2011 09:43 AM, Ioannis Canellos wrote:
> Hi all,
>
> I am having this error whenever I use a jms endpoint acting as a consumer
> that has as targetService a provider (e.g. http provider endpoint or
> implementations of SimpleEndpoint).
> If I put between these two any other endpoint (e.g. an eip wiretap or a
> pipeline) everything works fine.
>
>
> The detailed error message is:
> *Error while handling response:javax.jbi.messaging.MessagingException:
> java.lang.IllegalStateException: the transaction context set in the
> messageExchange is not bound to the current thread*
>
>