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
Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • Pingback: water ionizer plans()

  • Pingback: car parking()

  • Pingback: water ionizers()

  • Pingback: car parking()

  • Pingback: laan hurtige penge nu()

  • Pingback: fue.mobi()

  • Pingback: laan nu og her()

  • Pingback: tvpackages.net()

  • Pingback: tvpackages.net()

  • Pingback: best DIRECTV deals()

  • Pingback: I enjoy this real crap()

  • Pingback: best online casinos()

  • Pingback: alkaline water()

  • Pingback: watch tv show episodes()

  • Pingback: stream movies()

  • Pingback: stream movies()

  • Pingback: free movie downloads()

  • Pingback: Details()

  • Pingback: Blue Coaster33()

  • Meastro

    What is the solution for jboss 5?

  • 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

  • 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

    • Kaushal

      Hi PD,
      Please add jaxb-core.jar and ha-api.jar to server lib or project lib.
      I have downloaded jaxws-ri-2.2.8 and added following jars to my project lib folder
      1. gmbal-api-only.jar
      2. ha-api.jar
      3. jaxb-core.jar
      4. jaxb-impl.jar
      5. jaxws-api.jar
      6. jaxws-rt.jar
      7. management-api.jar
      8. policy.jar
      9. stax-ex.jar
      10. streambuffer.jar

      Hope it helps,

      Regards,
      kaushal

      • Chen Mingze

        I have met the same problem, your answer can absolutely solve it, thank you very much!

  • http://springjquery.blogspot.com Priyanka

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

  • Pingback: JAX-WS Tutorial()