Installing SOAPMonitor for Axis

From GEANT2-JRA1 Wiki

Step 1: Make sure you have the necessary files for soap monitor

Checklist:

  • SOAPMonitorApplet.java (usually present in the tomcat/webapps/axis directory)
  • deploy-monitor.wsdd -download
  • undeploy-monitor.wsdd - download


Step 2: Make sure your classpath contains the following jars

You can do this by either modifying CLASSPATH variable in .bash_profile (for unix) or by modifying it in Windows Environment Variables or by including the complete path to each of the following jar files in the javac and java commands (-cp option)

  • xercesImpl.jar
  • xml-apis.jar
  • xalan.jar
  • xmlrpc-1.2-patched.jar
  • xmlParserAPIs.jar
  • axis-1.4.jar
  • commons-discovery-0.2.jar
  • commons-logging-1.0.4.jar
  • jaxrpc.jar
  • saaj.jar
  • wsdl4j-1.5.1.jar
  • resolver.jar
  • log4j-1.2.8.jar
  • mail.jar

Note: The above list probably contains more jars than actually required. Also, the version numbers are the ones that have been tested with. You might be able to use a different version than the one specified above. Make sure that the axis.jar version is the same as the axis servlet that you are trying to deploy your service onto. Or else, you will get an IncompatibleClassChange error.


Step 3: Compile SOAPMonitorApplet.java

You can compile the java file with the help of the following command.

javac SOAPMonitorApplet.java

Of if you want to use the -cp option (if the axis.jar file is not in your classpath)

javac -cp %AXIS_HOME%\lib\axis.jar SOAPMonitorApplet.java


Step 4: Make sure resulting SOAPMonitoringApplet*.class (around 7 classes) are in your axis directory (ex: /home/loukik/tomcat/webapps/axis)


Step 5: Uncomment entries in WEB.xml

You will need uncomment the following lines in WEB.xml. Also, the SOAP monitor requires to run on a port (in the example its 5001). If the default port is already in use by some other application or some other SOAP monitor, you will need to set a different port number.

<servlet>
  <servlet-name>SOAPMonitorService</servlet-name>
  <display-name>SOAPMonitorService</display-name>
  <servlet-class>
       org.apache.axis.monitor.SOAPMonitorService
  </servlet-class>
  <init-param>
    <param-name>SOAPMonitorPort</param-name>
    <param-value>5001</param-value>
  </init-param>
  <load-on-startup>100</load-on-startup>
</servlet>


Step 6: Deploy

The following command was used to deploy the service. You will need to substitute localhost:8080 with your machine's hostname/ip address and port. (This is the machine which is running tomcat and where the service is installed)

java org.apache.axis.client.AdminClient 
    -lhttp://localhost:8080/axis/services/AdminService deploy-monitor.wsdd

or if you want to include the classpath here

java -cp %CLASSPATH% org.apache.axis.client.AdminClient 
    -lhttp://localhost:8080/axis/services/AdminService deploy-monitor.wsdd

Step 7: Modify .wsdd file for your service and Re-deploy them

By default, the .wsdd files that perfSONAR uses for deploying services currently does not support flows via a SOAP Monitor. It needs to be modified as below in order to monitor the flows using the SOAP monitor.

The modification is quite simple. The following lines need to be added to the deploy.wsdd file (ma-service-deploy.wsdd or mp-service-deploy.wsdd or ls-service-deploy.wsdd, etc). You can find this file in $PERFSONAR/build/org/perfsonar/service/web/wsdd directory.

<requestFlow>
      <handler name="soapmonitor"
          type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </requestFlow>
 
  <responseFlow>
      <handler name="soapmonitor"
          type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </responseFlow>

An example file showing these lines inserted in the wsdd can be found here.


Step 8: Re-deploy your service, restart Tomcat

After making changes to the wsdd file, you will need to undeploy the service and then re-deploy it. Check your service's installation guide for instructions on how to undeploy and deploy a service. After redeploying, tomcat will need to be restarted.


Step 9: Check your SOAP Monitor

You can check if your SOAP Monitor is working by clicking on the SOAPMonitor link on the axis page (usually http://localhost:8080/axis/SOAPMonitor). If the SOAPMonitor page loads, it means that the web.xml entry has been properly uncommented. If the SOAPMonitor page shows that the SOAPMonitor has started (see page here) it means all is ok. If not, check the port number (try making changes), restart tomcat and test again.


How to undeploy SOAP monitor

Ok, so you had enough of the SOAP Monitor :).Here is how you can undeploy it.

  • Undeploy SOAPMonitorService (make sure you have the undeploy-monitor.wsdd file - see step 1 if not)
java org.apache.axis.client.AdminClient 
    -lhttp://localhost:8080/axis/services/AdminService undeploy-monitor.wsdd

or

java -cp %CLASSPATH% org.apache.axis.client.AdminClient 
    -lhttp://localhost:8080/axis/services/AdminService undeploy-monitor.wsdd
  • Comment out the entries in web.xml
<!--
<servlet>
  <servlet-name>SOAPMonitorService</servlet-name>
  <display-name>SOAPMonitorService</display-name>
  <servlet-class>
       org.apache.axis.monitor.SOAPMonitorService
  </servlet-class>
  <init-param>
    <param-name>SOAPMonitorPort</param-name>
    <param-value>5001</param-value>
  </init-param>
  <load-on-startup>100</load-on-startup>
</servlet>
-->
  • Modify your deploy.wsdd file

If you do not modify your deploy.wsdd as specified below and re-deploy your service, your service will not work. Remove the following lines from it.

<requestFlow>
      <handler name="soapmonitor"
          type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </requestFlow>
 
  <responseFlow>
      <handler name="soapmonitor"
          type="java:org.apache.axis.handlers.SOAPMonitorHandler"/>
  </responseFlow>
  • Undeploy and then deploy your service

Look into your installation guide to find out how to undeploy and deploy your service

  • Restart Tomcat

Make sure you restart tomcat so that the changes can be applied.

Other pages: Apache pages on SOAP Monitor installation

Personal tools