2 Replies Latest reply on Aug 8, 2007 6:55 AM by Andrew Dinn

    Problem with WSTXInitialisation listener

    Karen Simonyan Newbie

      Hello!

      We are currently evaluating JBoss WS Transaction implementation and run into a small problem that I will try to explain below. In our sample application we are trying to run the client, web services participating in a transaction and the coordinator on different physical machines under Tomcat/Axis environment. The problem is on the client side, in the initialization of the JBossTS environment, when I try to specify the URL for the coordinator in the standard wstx.xml configuration file:

      <wstx-config>
       <properties>
       ....
       <!-- Initialization of coordinator URLs -->
      
       <property name="com.arjuna.mw.wst.coordinatorURL" value="http://SOME_HOST:8080/xts/soap/ActivationCoordinator">
       </property>
       <property name="com.arjuna.mw.wst.ba.terminatorURL" value="http://SOME_HOST:8080/xts/soap/BusinessActivityTerminatorParticipant">
       </property>
       <property name="com.arjuna.mw.wst.at.terminatorURL" value="http://SOME_HOST:8080/xts/soap/TerminatorParticipant">
       </property>
       </properties>
      </wstx-config>
      

      The corresponding listener is specified in the web.xml of the client web application:

      ...
      <!-- WSTX -->
       <listener>
      <listener-class>com.arjuna.mw.wst.deploy.WSTXInitialisation</listener-class>
      </listener>
      
      ....
      

      The problem is that the client is not able to find the coordinator even though the com.arjuna.mw.wst.coordinatorURL property is defined in wstx.xml. After a little debugging I was able to find the cause of this problem: in the contextInitialized(..) method of the WSTXInitialisation class
      wstx.xml is parsed and corresponding initialization performed after initializing UserTransaction (in case of AT). So if I change the contextInitialized(..) method to the following

      public void contextInitialized(final ServletContextEvent servletContextEvent)
       {
       try
       {
       Configuration.initialise("/wstx.xml");
       configure();
       // Start recovery
      // RecoveryManager.manager() ;
       }
       catch (Exception exception)
       {
       wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_1", exception);
       }
       catch (Error error)
       {
       wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_21", error);
       }
       }


      it works perfectly for me. Note that I have switched the places of the first two lines of code. I would appreciate any help on this topic.

      With best regards,
      Karen