activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulliard <cmoulli...@gmail.com>
Subject Unable to enlist XA resource manager !!
Date Mon, 15 Mar 2010 08:55:44 GMT

Hi,

I have configured ActiveMq on SMX4 to use Geronimo Transaction Manager and
ActiveMq Pooling but get this error when connection occurs on topics of
activemq advisory messages

09:46:47,125 | WARN  | tenerContainer-8 | Transaction                      |
nsaction.manager.TransactionImpl  213 | Unable to enlist XAResource org.a
pache.geronimo.transaction.manager.WrapperNamedXAResource@8450b0, errorCode:
-6
javax.transaction.xa.XAException
        at
org.apache.activemq.TransactionContext.start(TransactionContext.java:312)
        at
org.apache.activemq.ra.LocalAndXATransaction.start(LocalAndXATransaction.java:136)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.start(WrapperNamedXAResource.java:86)
        at
org.apache.geronimo.transaction.manager.TransactionImpl.enlistResource(TransactionImpl.java:209)
        at
org.apache.activemq.pool.XaConnectionPool.createSession(XaConnectionPool.java:57)
        at
org.apache.activemq.pool.PooledConnection.createSession(PooledConnection.java:141)
        at
org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:196)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.access$200(AbstractPollingMessageListenerContainer.java:78)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer$MessageListenerContainerResourceFactory.createSession(AbstractPoll
ingMessageListenerContainer.java:506)
        at
org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:301)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:2
86)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:241
)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer
.java:982)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerConta
iner.java:974)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
        at java.lang.Thread.run(Thread.java:619)

The camel routes using activemq are not defined as XA !!

Here is the config :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:camel="http://camel.apache.org/schema/osgi"
	xmlns:osgi="http://www.springframework.org/schema/osgi"
	xsi:schemaLocation="
	    http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
		http://camel.apache.org/schema/osgi
		http://camel.apache.org/schema/osgi/camel-osgi.xsd
		http://www.springframework.org/schema/osgi
        http://www.springframework.org/schema/osgi/spring-osgi.xsd">
		
	
    <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
    	<property name="transacted" value="true"/>
    	<property name="connectionFactory" ref="pooledConnectionFactory" />
        <property name="transactionManager">
			<osgi:reference
interface="org.springframework.transaction.PlatformTransactionManager"/>
		</property>
    </bean>

    <bean id="activemqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:61616" />
    </bean>
    
	<camel:camelContext id="routeJms" trace="true"
xmlns="http://camel.apache.org/schema/spring">

		<route id="Connection">
			<from
uri="activemq:topic:ActiveMQ.Advisory.Connection?mapJmsMessage=false&amp;cacheLevelName=CACHE_AUTO"
/>
			<convertBodyTo type="java.lang.String"/>
			<transform>
		      <simple>${in.body}&#13;</simple>
		    </transform>
			<to
uri="file://data/activemq/?fileExist=Append&amp;fileName=advisoryConnection-${date:now:yyyyMMdd}.txt"
/>
		</route>
    </camel:camelContext>
	
	
	<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactoryBean">
        <property name="maxConnections" value="8" />
        <property name="maximumActive" value="500" />
        <property name="transactionManager" ref="transactionManager" />
        <property name="connectionFactory" ref="activemqConnectionFactory"
/>
        <property name="resourceName" value="activemq.default" />
    </bean>

    <bean id="resourceManager"
class="org.apache.activemq.pool.ActiveMQResourceManager"
init-method="recoverResource">
          <property name="transactionManager" ref="transactionManager" />
          <property name="connectionFactory" ref="activemqConnectionFactory"
/>
          <property name="resourceName" value="activemq.default" />
    </bean>

    <osgi:reference id="transactionManager"
interface="javax.transaction.TransactionManager" />

    <osgi:service ref="pooledConnectionFactory">
        <osgi:interfaces>
            <value>javax.jms.ConnectionFactory</value>
        </osgi:interfaces>
        <osgi:service-properties>
            <entry key="name" value="default"/>
        </osgi:service-properties>
    </osgi:service>
		

</beans>

Kind regards,

Charles

-----
Charles Moulliard
SOA Architect

My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://old.nabble.com/Unable-to-enlist-XA-resource-manager-%21%21-tp27901651p27901651.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message