4 Replies Latest reply on Jun 2, 2006 5:41 AM by paul.robinson

    InvalidProtocolException when enlisting a Durable2PCParticip

    paul.robinson

      Hello,

      I have 2 instances of JBoss running on two physical machines in the following configuration:

      JBoss1
      This server hosts a jsp client and a single web service.

      JBoss2
      Ths server hosts a single web service (implemented the same as the service on JBoss1).

      The client obtains a UserTransaction, calls begin and then looks up and makes a call on each of the 2 Web services in turn. Finally, the client calls commit on the UserTransaction.

      When each of the Web services are called, they both enlist a Durable2PCParticipant with the transaction asociated with the thread. My Web service code is as follows:

      public void doWork()
      {
      String txid = UserTransactionFactory.userTransaction().toString();
      System.out.println(txid);
      Participant participant= new Particiapant();
      TransactionManagerFactory.transactionManager().enlistForDurableTwoPhase(participant, new Uid().toString());
      }


      When I execute my client on JBoss1, the call to the local Web service succesfully enlists a Durable2PCParticipant and the completion protocol calls prepare() and commit() on this participant.

      However, when the client calls the second web service, running on JBoss2, an InvalidProtocolException is thrown (see bellow for the trace).

      I have outputted the txid as the first thing done in both web services and they match. I have also outputted the txid on the client and it also matches.

      When I run both web services and client on JBoss1, the enlistment succeeds.

      I have looked at the Java Doc for this exception and it doesn't give me any helpfull information.

      Any help would be appreciated,

      Paul.


      11:42:46,906 INFO [STDOUT] AtomicTransactionIdentifier: a090ab6:5d4:447eb296:190
      11:42:47,094 INFO [STDOUT] com.arjuna.wst.SystemException: com.arjuna.wsc.InvalidProtocolException: [com.arjuna.wsc.messaging.RegistrationC
      oordinatorProcessorImpl_2] - Invalid protocol identifier
      11:42:47,094 INFO [STDOUT] at com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple.enlistForDurableTwoPhase(TransactionManagerImple.
      java:83)
      11:42:47,094 INFO [STDOUT] at com.arjuna.wstx.services.faultyAT.FaultyServiceAT.doWork(FaultyServiceAT.java:28)
      11:42:47,094 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:42:47,094 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      11:42:47,094 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      11:42:47,094 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:324)
      11:42:47,094 INFO [STDOUT] at org.jboss.webservice.server.InvokerProviderJSE.invokeServiceEndpoint(InvokerProviderJSE.java:154)
      11:42:47,094 INFO [STDOUT] at org.jboss.webservice.server.InvokerProvider.invokeMethod(InvokerProvider.java:305)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.providers.java.RPCProvider.invokeTarget(RPCProvider.java:176)
      11:42:47,094 INFO [STDOUT] at org.jboss.webservice.server.InvokerProviderJSE.invokeTarget(InvokerProviderJSE.java:93)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:358)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)
      11:42:47,094 INFO [STDOUT] at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.java:200)
      11:42:47,094 INFO [STDOUT] at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:911)
      11:42:47,094 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      11:42:47,094 INFO [STDOUT] at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
      11:42:47,094 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:42:47,094 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      11:42:47,094 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      11:42:47,094 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      11:42:47,094 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      11:42:47,094 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      11:42:47,094 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      11:42:47,094 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744
      )
      11:42:47,094 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      11:42:47,109 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      11:42:47,109 INFO [STDOUT] at java.lang.Thread.run(Thread.java:536)


        • 1. Re: InvalidProtocolException when enlisting a Durable2PCPart
          kconner

          There are two circumstances which could cause this exception to be raised.

          The first is that the protocol being requested is not registered with the registration service. This shouldn't be happening though as we hide those details below the API you are using.

          The second is that there has been a problem restoring the transaction at the registration service.

          Is it possible for you to send me the initial webservice request from the jboss1 client to the jboss2 service?

          Thanks,
          Kev

          • 2. Re: InvalidProtocolException when enlisting a Durable2PCPart
            paul.robinson

            Thanks for th response, here it is...

            POST /faultyservices/FaultyServiceAT HTTP/1.0
            Content-Type: text/xml; charset=utf-8
            Accept: application/soap+xml, application/dime, multipart/related, text/*
            User-Agent: JBoss WS4EE/JBossAS 4.0.3SP1
            Host: localhost:8081
            Cache-Control: no-cache
            Pragma: no-cache
            SOAPAction: ""
            Content-Length: 1383
            
            <?xml version="1.0" encoding="UTF-8"?>
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <soapenv:Header>
             <wscoor:CoordinationContext xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
             <wscoor:Identifier xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">a090ab6:ab7:447ff730:86</wscoor:Identifier>
             <wscoor:CoordinationType xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">http://schemas.xmlsoap.org/ws/2004/10/wsat</wscoor:CoordinationType>
             <wscoor:RegistrationService xmlns:wscoor="http://schemas.xmlsoap.org/ws/2004/10/wscoor">
             <wsa:Address xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8080/xts/soap/RegistrationCoordinator</wsa:Address>
             <wsa:ReferenceParameters xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
             <wsarj:InstanceIdentifier xmlns:wsarj="http://schemas.arjuna.com/ws/2005/10/wsarj">a090ab6:ab7:447ff730:86</wsarj:InstanceIdentifier>
             </wsa:ReferenceParameters>
             </wscoor:RegistrationService>
             </wscoor:CoordinationContext>
             </soapenv:Header>
             <soapenv:Body>
             <ns1:doWork xmlns:ns1="http://www.jboss.com/jbosstm/xts/demo/Faulty">
             <in0>B</in0>
             <in1>hello</in1>
             <in2>0</in2>
             </ns1:doWork>
             </soapenv:Body>
            </soapenv:Envelope>


            • 3. Re: InvalidProtocolException when enlisting a Durable2PCPart
              kconner

              Ah, okay.

              The problem is that the registration service is configured for the loopback address.

              The ws-c.war and ws-t.war file need to have their web.xml modified to update the BaseHttpURI and BaseHttpsURI properties. The build.xml in the demo directory achieves this in the 'insertcfg' target.

              Can you please modify those web.xml files and retry your test?

              Thanks,
              Kev

              • 4. Re: InvalidProtocolException when enlisting a Durable2PCPart
                paul.robinson

                Thanks a lot,

                That worked!