Getting Axis’s SOAPMonitor working and fixing AppletClassLoader’s NoClassFoundException

I was playing around with Axis2. Developing some POC type web services to understand the new capabilities that Axis has added in its armoury.

Apparently Axis provides a ready-to-use tool for monitoring the SOAP messages flowing between the Axis web service and its consumers. The tool is called SOAPMonitor and information regarding the installation is available here. I followed the instructions mentioned in the site and found to my utter dismay, the appletclassloader throwing NoClassFoundException. Did some googling and found a host of solutions which unfortunately did not solve the problem at hand.

Finally here’s what I did which solved the issue. I created a custom HTML page test.html.

The HTML contents are as below:

        <TITLE>SOAP Monitor</TITLE>
        <H1>Hello There</H1>
        <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width=100% height=100%
            <param name="code" value="SOAPMonitorApplet.class"/>
            <param name="type" value="application/x-java-applet;version=1.3"/>
            <param name="scriptable" value="false"/>
            <param name="port" value="5001"/>
                <embed type="application/x-java-applet;version=1.3" code=org.apache.axis2.soapmonitor.applet.SOAPMonitorApplet.class width=100% height=100% port=\"" + port + "\" scriptable=false pluginspage="">                    

The content of the HTML is similar to the HTML page generated by the SOAPMonitorService servlet. I made some minor modifications to that HTML rendition. In the param named code instead of referring to the entire class name i.e org.apache.axis2.soapmonitor.applet.SOAPMonitorApplet.class, we pass the value “SOAPMonitorApplet.class”. The param port was hardcoded to 5001 which is the default port for sOAP monitoring. Ensure that you have JDK 1.3 and higher java plugin installed on your web browser. The contents within comment tag apparently do not impact the final page rendition. I took the source code of SOAPMonitorApplet class and made some modifications.

  1. The package name of the class was changed from org.apache.axis2.soapmonitor.applet. to default package, i.e. no package name.
  2. SOAPMonitorApplet class had a dependency on SOAPMonitorConstants class. That dependency was removed and the values for SOAP_MONITOR_REQUEST and SOAP_MONITOR_RESPONSE was hard coded in the SOAPMonitorApplet class.
  3. The SOAPMonitorApplet class was compiled and deployed to webapps\axis2 folder, provided axis2 is the axis webservices route folder.
  4. I removed the soapmonitor-1.4.jar from the webapps\axis2\WEB-INF\lib folder. All classes within the org.apache.axis2.soapmonitor.servlet package were deployed within the webapps\axis2\WEB-INF\classes folder.
  5. The newly created HTML test.html was deployed in the webapps\axis2 folder. The HTML was co-located with the applet class.

I started the Tomcat server and presto the SOAPMonitor was up and running. Note the deployment was done on Tomcat 5.5


8 thoughts on “Getting Axis’s SOAPMonitor working and fixing AppletClassLoader’s NoClassFoundException

  1. Try to make the next tree of folders org, apache, axis2, soapmonitor and applet within the axis2.war root folder.

  2. I did make the folders as per the package structure within the axis2 root folder. It still gave me a ClassNotFoundException.

  3. I found all I needed to do to get aound the class not found exception was to add the “archive” attribute to the embed tag, with the value of the name of the soapmonitor jar file.

    I’m using Axis2 1.4,

    I did the view source of the page that was returned by the SOAPMonitor servlet, and edited the embed tag to be

    and then saved it as soapMonitor.jsp. I just hit that page instead of the SOAPMonitor servlet mapped path one.

  4. Thank you for the tutorial. I am able to see the monitor window but no messages are appearing. Can you please let me know what I am doing wrong.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s