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

Problem

Deploying a JAX-WS web service on Tomcat, hits following error message :


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

Solution

The JAX-WS dependency library “jaxws-rt.jar” is missing.

  1. Go here http://jax-ws.java.net/.
  2. Download JAX-WS RI distribution.
  3. Unzip it and copy “jaxws-rt.jar” to Tomcat library folder “{$TOMCAT}/lib“.
  4. Restart Tomcat.

Reference

  1. WSServletContextListener JavaDoc

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
6 Comment threads
3 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
8 Comment authors
Tom BriscoeSmrita GargMeastroChen MingzeKaushal Recent comment authors
newest oldest most voted
trackback
JAX-WS Tutorial

[…] in use: bindWrapper class package.jaxws.methodName is not found. Have you run APT to generate them?java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListenerjava.lang.ClassNotFoundException : […]

Priyanka
Guest
Priyanka

If i use jetty plugin & use it as my server, then how to do that ?

Praveen Das
Guest
Praveen Das

Hi MKYong,
Getting the below error even after adding the jaxws-rt.jar.

SEVERE: Error configuring application listener of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
java.lang.NoClassDefFoundError: com/sun/istack/localization/Localizable

Tried adding the following jars, no luck –
jaxb-impl-2.1.10.jar , com.springsource.com.sun.xml.bind-sources-2.2.0.jar

Appreciate your help.
Regards,
PD

Pallavi
Guest
Pallavi

Hi MKYong,
Getting the below error even after adding the jaxws-rt.jar while starting the tomcat.

Jun 20, 2013 1:07:57 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3915)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Jun 20, 2013 1:07:57 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Jun 20, 2013 1:07:57 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 20, 2013 1:07:57 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/HelloWorld] startup failed due to previous errors

Appreciate your help.
Thanks in advance.
Regards,
Pallavi

Meastro
Guest
Meastro

What is the solution for jboss 5?

Tom Briscoe
Guest
Tom Briscoe

Java.net is shut down. The links on this page no longer work.