Skip to main content

Running JAX-WS Samples with Tomcat 6.x

Posted by ramapulavarthi on July 20, 2007 at 4:48 PM PDT

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/ and set shared.loader={RI Installation Directory}/lib/*.jar
If you are running multiple instances of Tomcat, then edit CATALINA_BASE/conf/ 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.


JAX-WS Samples


Related Topics >>


With Tomcat 5.5 and its previous versions, the folder ...

With Tomcat 5.5 and its previous versions, the folder lib/endorsed was used as tomcat lib, but that's changed to /endorsed in the new tomcat releases. (6.x & 7.x). Hope this helps if you face errors while doing java Hosting

See a related post to find the solution for the endorsed mechanism with Tomcat 6.x

Thank you for your post. I encountered this exact same error yesterday.

Hi Rama, I am experiencing the same problem. I developed my webservices server in NetBeans 5.5 on my localhost (Apache Tomcat 6.0) and i pointed to 2.1 APIs in classpath to the ones that come with NetBeans IDE and its working perfectly fine. But when i try to take the war file and put in our server and deploy it which also has Tomcat 6.0, i am getting the same linking error that says 2.0 API is being loaded and it needs 2.1 APIs. Let me tell you what i have done to resolve this in our server. 1.I put the JAX 2.1 jars in my JAVA_HOME\lib\endorsed folder and put it in my class path.(which is the fix that many people prosposed and even the docs that i downloaded with JAXWS-2.1 APIs suggested) 2.I have also put the 2.1 jars in my Tomcat\lib folder 3.I have also set the shared.loader property to point to the location where my 2.1 APIs live (ie Tomcat\lib) But for some reason it just doesnt work. Any help would be greatly appreciated. Sorry for the big post as i just wanted to explain things clearly. Thanks, Vivek