WS-AT transactions on nested web services calls failing
veerla Oct 23, 2012 7:35 AMHi,
I am trying on web service transaction (XTS) and made progress on achieving it using one web service call. Now when i try to call another web service from already called web service, i see the below exception. Help me in solving this. Attached complete stack trace.
Flow: I have 2 projects, 1 client and 1 server. on the client side i have servlet, a service with spring transactions and a web service (WS1 ) proxy to call.
On the server side, i have services with spring transactions( all the services are with mandatory propagation), dao for db operations (using XA datasource) and 2 web services (WS1 and WS2) and WS2 proxy for calling WS2.
From client, service annotated with spring transactions, i have a call to Web service (WS1) via proxy, which is configured with jaxws-handlers.xml
Client XML:
<?xml version="1.0" encoding="UTF-8"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<protocol-bindings>##SOAP11_HTTP</protocol-bindings>
<handler>
<handler-name>TransactionBridgeHandler</handler-name>
<handler-class>org.jboss.jbossts.txbridge.outbound.JaxWSTxOutboundBridgeHandler</handler-class>
</handler>
<handler>
<handler-name>ContextHandler</handler-name>
<handler-class>com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor</handler-class>
</handler>
</handler-chain>
</handler-chains>
On the server side, the web service (WS1) method has call to local service which does a db operation via another service (all are spring annotated with propagation as mandatory) and a call to web service (WS2) via proxy which inturn has a call to other service to do a db operation.
In this scenario, i am getting the below exception. If i remove the second web service call, it is working and also if i start a subordinate transaction before calling web service (WS2) and remove the JaxWSTxOutboundBridgeHandler from the handler xml it is again working.
Server XML:
<?xml version="1.0" encoding="UTF-8"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<protocol-bindings>##SOAP11_HTTP</protocol-bindings>
<handler>
<handler-name>TransactionBridgeHandler</handler-name>
<handler-class>org.jboss.jbossts.txbridge.inbound.JaxWSTxInboundBridgeHandler</handler-class>
</handler>
<handler>
<handler-name>ContextHandler</handler-name>
<handler-class>com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor</handler-class>
</handler>
</handler-chain>
</handler-chains>
09:24:26,203 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) TransactionImple.getStatus
09:24:26,204 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) JaxWSTxOutboundBridgeHandler.handleMessage()
09:24:26,204 ERROR [org.jboss.as.txn] (http-localhost-127.0.0.1-8080-3) JBAS010152: APPLICATION ERROR: transaction still active in request with status 0
09:24:26,204 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) JaxWSTxOutboundBridgeHandler.handleInbound()
09:24:26,205 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) BaseTransaction.rollback
09:24:26,205 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) JaxWSTxOutboundBridgeHandler.suspendTransaction()
09:24:26,206 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) OutboundBridgeManager.getOutboundBridge()
09:24:26,207 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) OutboundBridge.stop(BridgeWrapper=org.jboss.jbossts.xts.bridge.at.BridgeWrapper@4c69d284)
09:24:26,206 ERROR [org.jboss.as.txn] (http-localhost-127.0.0.1-8080-3) JBAS010150: Unable to roll back active transaction: com.arjuna.ats.jta.exceptions.InvalidTerminationStateException
at com.arjuna.ats.internal.jta.transaction.arjunacore.subordinate.TransactionImple.rollbackAndDisassociate(TransactionImple.java:358) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:134) [jbossjts-4.16.2.Final.jar:]
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:114)
at org.jboss.as.txn.deployment.TransactionRollbackSetupAction.teardown(TransactionRollbackSetupAction.java:55)
at org.jboss.as.web.ThreadSetupBindingListener.unbind(ThreadSetupBindingListener.java:61) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]
09:24:26,207 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-1) JaxWSTxOutboundBridgeHandler.close().
Thanks in advance.
-
stack_trace.txt.zip 11.2 KB