Deploying Your Java Web Service to Tomcat 6

I have my java web service up and running, and I am deploying it to Tomcat.  However, when Tomcat starts up, the deployment is failing with the following exception:

java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListener

I am told that Tomcat should have everything it needs, but that is clearly referring to Tomcat 5 and not Tomcat 6.

According to Techie Gyan, the following is the problem:

“The second change which tells about the cause of the error above is that tomcat 6.0 supports JAX-WS 2.1 and not JAX-WS 2.0 and java 6 supports 2.0 only (till some version, now it started supporting the newer version as well).”

My approach to fixing the problem is different, but it works:

  1. Go to https://jax-ws.dev.java.net/
  2. Download the latest version (2.2 at the time of this writing)
  3. Unzip the file and place the jars in Tomcat’s lib directory
  4. Restart Tomcat

Now I have no issues accessing my web service from Tomcat.

Advertisements

One thought on “Deploying Your Java Web Service to Tomcat 6

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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