1 2 Previous Next 23 Replies Latest reply on Nov 22, 2012 6:49 AM by Paul Robinson

    WS-AT transactions on nested web services calls failing

    Thirupathi Rao Veerla Newbie

      Hi,

      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.

        • 1. Re: WS-AT transactions on nested web services calls failing
          Paul Robinson Master

          Hello,

           

          Just to be clear, I think you have the following scenario:

           

          Client (JTA) -> JTA-WSAT bridge -> NETWORK -> WSAT-JTA bridge -> WS1 (JTA) -> JTA-WSAT bridge -> NETWORK -> WSAT-JTA bridge -> WS2 (JTA)

           

          Does that make sense?

           

          Also, can you tell me what version of JBossAS you are using?

           

          Thanks,

           

          Paul.

          • 2. Re: WS-AT transactions on nested web services calls failing
            Thirupathi Rao Veerla Newbie

            Yes Paul,

            your understanding is correct. Both the web services are running in one JbossAS, but called  via poxy objects.

            I am using JBoss AS 7.1.1.

            • 3. Re: WS-AT transactions on nested web services calls failing
              Paul Robinson Master

              Thirupathi,

               

              We've been discussing your scenario and we think it should work. However, there may be a bug in XTS caused by the fact that you are running this all on the same VM. Are you able to re-run with WS2 on a different AS7 instance? If you can run the client on a separate instance, can you do that too? It would be good to rule this out first.

               

              I'll have a go at setting up an example that emulates your scenario in as simple a way as possible.

               

              Paul.

              • 4. Re: WS-AT transactions on nested web services calls failing
                Thirupathi Rao Veerla Newbie

                As per the attached logs, i guess, In this use case, the transaction bridge handler on the client side is giving the existing WS-AT transaction context instead of creating new one for second web service, because of this, WS-AT transaction is closed when WS2 call is ended and when WS1 call is ended, the transaction is not found and throwing com.arjuna.wst.UnknownTransactionException.

                 

                 

                still if i use the code in this way and remove the outbound handler from the context xml of client, it works,

                 

                <?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>ContextHandler</handler-name>

                                              <handler-class>com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor</handler-class>

                                    </handler>

                    </handler-chain>

                </handler-chains>

                 

                 

                try {

                                                                  UserTransaction.getUserTransaction().getUserSubordinateTransaction().begin();

                WS2Service service1 = new WS2Service();

                         WS2 port1 = service1.getWS2Port();

                         port1.callWS2(text);

                 

                                                        } catch (WrongStateException e) {

                                                                  // TODO Auto-generated catch block

                                                                  e.printStackTrace();

                                                        } catch (SystemException e) {

                                                                  // TODO Auto-generated catch block

                                                                  e.printStackTrace();

                                                        }

                 

                 

                Thanks,

                Thiru

                • 5. Re: WS-AT transactions on nested web services calls failing
                  Thirupathi Rao Veerla Newbie

                  as per the bridge code,  external id is comming as unknown, is there a bug over here or am i doing something wrong?

                   

                  String externalTxId = UserTransactionFactory.userTransaction().toString();

                   

                   

                      if (!inboundBridgeMappings.containsKey(externalTxId)) {

                        createMapping(externalTxId);

                      }

                   

                  snippet from the log,

                   

                   

                  09:24:26,193 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) BaseTransaction.getStatus

                  09:24:26,194 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) TransactionImple.getStatus

                  09:24:26,194 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) BaseTransaction.getStatus

                  09:24:26,194 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) TransactionImple.getStatus

                  09:24:26,195 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) TransactionImple.registerSynchronization

                  09:24:26,196 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) JaxWSTxInboundBridgeHandler.handleMessage()

                  09:24:26,197 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) JaxWSTxInboundBridgeHandler.handleOutbound()

                  09:24:26,197 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) JaxWSTxInboundBridgeHandler.suspendTransaction()

                  09:24:26,197 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) InboundBridgeManager.getInboundBridge()

                  09:24:26,198 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) InboundBridgeManager.createMapping(externalTxId=Unknown)

                  09:24:26,199 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) BridgeDurableParticipant.<ctor>(TxId=Unknown, Xid=< 131080, 29, 64, 0000000000-1-1106736697111-2011480-12220-620007749, 292929292929292929292828399665351261409143109-9349-33292929106782929292929292929292929292929292929292929292929292929292929292929292929 >)

                  09:24:26,201 ERROR [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) com.arjuna.wst.UnknownTransactionException

                  09:24:26,202 TRACE [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8080-3) JaxWSTxInboundBridgeHandler.close()

                  09:24:26,203 TRACE [com.arjuna.ats.jta] (http-localhost-127.0.0.1-8080-3) BaseTransaction.getStatus

                  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()

                  09:24:26,213 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) End of local service jta

                  • 6. Re: WS-AT transactions on nested web services calls failing
                    Thirupathi Rao Veerla Newbie

                    i deployed WS2 on another jboss AS and tried, i still see the same issue. This is thrown on client server.

                     

                    18:20:16,555 ERROR [org.jboss.jbossts.txbridge] (http-localhost-127.0.0.1-8081-2) com.arjuna.wst.UnknownTransactionException

                    18:20:16,557 ERROR [org.jboss.as.txn] (http-localhost-127.0.0.1-8081-2) JBAS010152: APPLICATION ERROR: transaction still active in request with status 0

                    18:20:16,558 INFO  [stdout] (http-localhost-127.0.0.1-8081-1) tx after call: AtomicTransactionIdentifier: urn:0:ffffc0a80065:51b526ee:5087e37f:6c

                     

                     

                    18:20:16,559 INFO  [stdout] (http-localhost-127.0.0.1-8081-1) End serve of local service

                     

                     

                    18:20:16,559 ERROR [org.jboss.as.txn] (http-localhost-127.0.0.1-8081-2) 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]

                    • 7. Re: WS-AT transactions on nested web services calls failing
                      Paul Robinson Master

                      Thanks for giving that a go.

                       

                      I should be able to create a simple example, today or tomorrow, to reproduce this. I'll get back to you then.

                       

                      Paul.

                      • 9. Re: WS-AT transactions on nested web services calls failing
                        Paul Robinson Master

                        Thirupathi,

                         

                        I'm afraid I wasn't able to find the time to reproduce this today. I've created a Jira issue to create a Quickstart that demonstrates this scenario:

                         

                        https://issues.jboss.org/browse/JBTM-1321

                         

                        Hopefully I can take a look early next week.

                         

                        Paul.

                        • 10. Re: WS-AT transactions on nested web services calls failing
                          Paul Robinson Master

                          Thirupathi,

                           

                          FYI, I've reproduced this issue in my quickstart. I'll investigate now and then create a Jira issue for you to track once I have so more information. I'll also push the quickstart to the narayana quickstarts project when it is ready.

                           

                          Paul.

                          • 12. Re: WS-AT transactions on nested web services calls failing
                            Thirupathi Rao Veerla Newbie

                            Thanks Paul!

                            In between, why it is called narayana, it was arjuna right? what difference does both make?

                             

                            Thanks again

                             

                            -Thiru

                            • 13. Re: WS-AT transactions on nested web services calls failing
                              Paul Robinson Master

                              Thirupathi,

                               

                              It was called Arjuna in the beginning as that was the name of the research project where it was founded. It kept the name when the project was spun out into a separate company. The TS was subsequently owned by several companies and each renamed it. When JBoss acquired the software, they named it JBossTS. There is now a push to rename the community versions of the projects to remove 'JBoss' from the name. To this end a new name was chosen that was in keeping with its Indian roots, whilst also getting past the legal department. This was how Narayana was chosen.

                               

                              Paul.

                              • 14. Re: WS-AT transactions on nested web services calls failing
                                Paul Robinson Master

                                You may have noticed that I've resolved JBTM-1323. However, there's still a problem if you run both services on the same AS7 instance: https://issues.jboss.org/browse/JBTM-1325. I'm hoping to resolve JBTM-1325 this week.

                                 

                                If you want to make progress before JBTM-1325 is resolved, you'll need to run the services on different servers.

                                 

                                Paul.

                                1 2 Previous Next