I tried to run JAX-WS samples with Tomcat 6.0 and stumbled with the classloading problem. After reading the docs, I figured it out and thought of sharing this to all.

The JAX-WS Samples documentation describes steps for running samples with Glassfish and Tomcat 5.x. It suggests you to copy all web services jars to $CATALINA_HOME/shared/lib when running with Tomcat, so that these libraries can be available to all Web applications.

When you are running with Tomcat 6.x, the classloading mechanism has changed a bit from earlier versions of Tomcat. You can notice there is no common, server, shared directories in the Tomcat installation. All you see is the lib directory. It seems this is done to avoid confusion for the users. You can find more details about the Tomcat 6.0 classloading here

To run the samples with Tomcat 6 follow these steps. Edit $CATALINA_HOME/conf/catalina.properties and set shared.loader={RI Installation Directory}/lib/*.jar If you are running multiple instances of Tomcat, then edit CATALINA_BASE/conf/catalina.properties for that particular instance. The same technique can be used with Tomcat 5.x if you don't like to copy all the jars to $CATALINA_HOME/shared/lib

For the complete steps for running the samples, follow as instructions listed in the samples document.

Technorati:
JAX-WS Samples
Tomcat