The Source for Java Technology Collaboration
User: Password:



Rama Pulavarthi

Rama Pulavarthi's Blog

Running JAX-WS Samples with Tomcat 6.x

Posted by ramapulavarthi on July 20, 2007 at 04:48 PM | Comments (2)

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


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

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

    Posted by: gregoryc on August 08, 2007 at 05:58 AM

  • 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

    Posted by: vivshan on September 25, 2007 at 05:18 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds