Tomcat Server Stub Installation


Prerequisites

The following describes the requirements for installing the JaxView agent stub for Apache Tomcat and Axis:

Installation Instructions for Apache Axis

The following are the steps to set up the agent stub for Apache Axis running on Tomcat:

  1. Put the mm_stub.jar in the class path of the Web service application class path. This could be done by installing the jar files in the \WEB-INF\lib directory or the <tomcat_home>\shared\lib directory.

    Note: If you are using Tomcat shipped with JaxView, you may need to copy the files from <jaxView_home>\tomcat\webapps\Hubble\WEB-INF\lib to the shared\lib directory also.

  2. Add the handler and the handler chain according to the >> directions for the container. For example, for Axis, locate the server-config.wsdd file in the \WEB-INF\ directory of the Axis directory structure.
  3. Insert the following in the server-config.wsdd file for each service you want monitored.

    Replace jaxview_server with the address of the server where JaxView is running. If this is the Tomcat installation shipped with JaxView then use LocalHost.

    <requestFlow>
    <handler name="MessageHandlerJaxRpc"
    type="java:org.apache.axis.handlers.JAXRPCHandler">
    <parameter name="hubbleURL" value="http://<jaxview_server>:9090"/>
    <parameter name="className" value="com.hubble.clientservice.MessageHandlerJaxRpc"/>
    </handler>
    </requestFlow>
    <responseFlow>
    <handler name="MessageHandlerJaxRpc"
    type="java:org.apache.axis.handlers.JAXRPCHandler">
    <parameter name="hubbleURL" value="http:/<jaxview_server>:9090"/>
    <parameter name="className" value="com.hubble.clientservice.MessageHandlerJaxRpc"/>
    </handler>
    

  4. If communication between the agent stub and the JaxView server must go through a proxy, include the following parameters for the proxy server authentication:

    <parameter name="ProxyUsername" value="username"/>
    <parameter name="ProxyPassword" value="password"/>
    

  5. Modify the web.xml file for the servlet container with the following:

    <servlet>
     <servlet-name>StubServlet</servlet-name>
       <servlet-class>
         com.hubble.clientservice.StubServlet
       </servlet-class>
    </servlet>
    <servlet-mapping>
       <servlet-name>StubServlet</servlet-name>
       <url-pattern>/servlet/StubServlet</url-pattern>
    </servlet-mapping>
    

    These settings are needed to allow the agent to be configured remotely from JaxView.

  6. Set the JVConfigFilePath parameter to the directory path for error log and stub properties file. If this parameter is not set in the container configuration file then JaxView will use the directory specified by JAVA_HOME as the default. A properties file called jv.properties will be created in the JAVA_HOME directory to keep stub parameters.
  7. Re-start the application server for the changes to take effect.

Installation Instructions for Tomcat without Axis

The following are the steps to set up the agent stub for Tomcat:

  1. Put the mm_stub.jar in the class path of the Web service application class path. This could be done by installing the jar files in the \WEB-INF\lib directory or the <tomcat_home>\shared\lib directory.

    Note: If you are using Tomcat shipped with JaxView, you may need to copy the files from <jaxView_home>\tomcat\webapps\Hubble\WEB-INF\lib to the shared\lib directory also.

  2. Add the handler and the handler chain according to the directions for the container. For more information on how to install Handler Chains on Tomcat see the Sun Tutorial

    For example, locate the jaxrpc-ri.xml file in the /web-inf/jaxrpc-ri.xml file. Insert the following in the jaxrpc-ri.xml file after <endpoint>

    Replace jaxview_server with the address of the server where JaxView is running.

    <handlerChains>
    <chain runAt="server">
    <handler className="com.hubble.clientservice.MessageHandlerJaxRpc">
    <property name="hubbleURL" value="http://<jaxview_server>:9090"/>
    </handler>
    </chain>
    </handlerChains>
    

  3. If communication between the agent stub and the JaxView server must go through a proxy, include the following parameters for the proxy server authentication:

    <parameter name="ProxyUsername" value="username"/>
    <parameter name="ProxyPassword" value="password"/>
    

  4. Modify the web.xml file for the servlet container with the following:

    <servlet>
     <servlet-name>StubServlet</servlet-name>
       <servlet-class>
         com.hubble.clientservice.StubServlet
       </servlet-class>
    </servlet>
    <servlet-mapping>
       <servlet-name>StubServlet</servlet-name>
       <url-pattern>/servlet/StubServlet</url-pattern>
    </servlet-mapping>
    

    These settings are needed to allow the agent to be configured remotely from JaxView.

  5. Set the JVConfigFilePath parameter to the directory path for error log and stub properties file. If this parameter is not set in the container configuration file then JaxView will use the directory specified by JAVA_HOME as the default. A properties file called jv.properties will be created in the JAVA_HOME directory to keep stub parameters.
  6. Re-start the application server for the changes to take effect.