Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've been experimenting with WS-Atomic Transaction for a number of years now, though none of that work has made it past the POC stages...until now. Then, recently I've started working on a web service that made use of WS-AT to ensure that data was committed atomically between two distinct products in the stack, both of which were running in separate WebLogic managed servers. Everything was going just fine until we enabled the use of TransactionalFeature on the web service proxies and all hell broke loose...

None of the WS-AT enabled web service calls would work and failed with the following exception...
 Error
weblogic.transaction.RollbackException : Could not prepare resource '0BI_WSATGatewayRMxxxx
Failed state during prepare of WS-AT XAResource:WSATXAResource: xidBEA1-xxxx status:Aborted epr:<?xml version="1.0" encoding="UTF-8"?>
<ns0:EndpointReference xmlns:ns0="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ns0:Address>http://1.1.1.1:1111/wls-wsat/ParticipantPortType</ns0:Address><ns0:ReferenceParameters><wls-wsat:txId xmlns:wls-wsat="http://weblogic.wsee.wstx.wsat/ws/2008/10/wsat">FF1D-xxxx</wls-wsat:txId><wls-wsat:routing xmlns:wls-wsat="http://weblogic.wsee.wstx.wsat/ws/2008/10/wsat">WLS_xxxx</wls-wsat:routing></ns0:ReferenceParameters></ns0:EndpointReference> isRemovedFromMap:false
at org.glassfish.transaction.TransactionManagerImplCommon.commit(TransactionManagerImplCommon.java:535)
at org.glassfish.transaction.TransactionManagerImplCommon.commit(TransactionManagerImplCommon.java:529)
...
Caused by: javax.transaction.xa.XAException : Failed state during prepare of WS-AT XAResource:WSATXAResource: xidBEA1-xxxx status:Aborted epr:<?xml version="1.0" encoding="UTF-8"?>
<ns0:EndpointReference xmlns:ns0="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ns0:Address>http://1.1.1.1:1111/wls-wsat/ParticipantPortType</ns0:Address><ns0:ReferenceParameters><wls-wsat:txId xmlns:wls-wsat="http://weblogic.wsee.wstx.wsat/ws/2008/10/wsat">FF1D-xxxx</wls-wsat:txId><wls-wsat:routing xmlns:wls-wsat="http://weblogic.wsee.wstx.wsat/ws/2008/10/wsat">WLS_xxxx</wls-wsat:routing></ns0:ReferenceParameters></ns0:EndpointReference> isRemovedFromMap:false
at org.glassfish.transaction.TransactionManagerImplCommon.commit(TransactionManagerImplCommon.java:535)
at org.glassfish.transaction.TransactionManagerImplCommon.commit(TransactionManagerImplCommon.java:529)
...


This was strange because all of the code was dot-to-dot as per the documentation and the data source connection pool was set up with the oracle.jdbc.xa.client.OracleXADataSource driver. It should have worked.
wsaterr_1.png




I figured that there had to be some problem with the data source still, so I went looking around. And I didn't have to go far because the Transaction configuration tab revealed the problem.
wsaterr_2.png


The "Use XA Data Source Interface" option was not enabled! The fix was of course to enable this option and then restart WebLogic. Once that was done all WS-AT calls worked perfectly.

So the exception message may not have been very intuitive but the fix certainly was. It pays to inspect configuration on the managed server side when using new features that depend on the environment being configured correctly first. Lesson learned - don't assume that all configuration is going to be as expected!

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...