Hi all,

I’m trying to achieve following scenario using JMS distributed transactions
with ActiveMQ.

Scenario.
There's are multiple queues and a message needs to be sent to each of these
queue. If at least one of the queues is not reachable, none of the queues
should commit the message.

I found out that we need to add the following parameter axis2.xml to enable
XA Transaction in JMS Transport.

<parameter name="transport.Transactionality" locked="true">jta</parameter>

But when I do, I get the following exception in the console.

[2016-02-26 09:26:51,697] ERROR - ServiceTaskManager Error looking up
UserTransaction : java:comp/UserTransaction using JNDI properties :
{java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory,
java.naming.provider.url=tcp://localhost:61616,
interface=SimpleStockQuoteServicePortType,
transport.jms.ConnectionFactoryType=queue, serviceType=proxy}
javax.naming.NamingException: scheme java not recognized
at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:221)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:643)
at
org.apache.axis2.transport.jms.ServiceTaskManager.getUserTransaction(ServiceTaskManager.java:1025)
at
org.apache.axis2.transport.jms.ServiceTaskManager.access$600(ServiceTaskManager.java:50)
at
org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:434)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

I debug the axis2 transport code and found out UserTransaction was
evaluated to null. According to mail thread[1] that is because
"UserTransaction" was not available in the JNDI context axis2 transport was
looking at.

Can some help me to figure out how can I change axis2-transport-jms to make
the "UserTransaction" available for XA transactions?


[1]. ESB Distributed XA Transactions with JMS

Thanks.

-- 
Vijitha Ekanayake
Software Engineer*, *WSO2, Inc.; http://wso2.com/
Mobile : +94 777 24 73 39 | +94 718 74 44 08
lean.enterprise.middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to