[Solved] com.sun.xml.ws.transport.http.servlet.WSServletContextListener ClassNotFoundException

Posted on : Tue, 22nd Sep 15 02:31 pm UTC
2314 votes

The reason for ClassNotFoundException : com.sun.xml.ws.transport.http.servlet.WSServletContextListener in your Java Based Web Service Application (jax-ws) must be that you missed to add jaxws-rt.jar file or other files related to Web Services. Make sure that the below list of files are present under your Project -> WEB-INF/lib folder :

  1. jaxb-core.jar
  2. jaxb-impl.jar
  3. jaxws-api.jar
  4. jaxws-rt.jar
  5. management-api.jar
  6. policy.jar
  7. stax-ex.jar
  8. streambuffer.jar
Exception Stack trace : 

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:1710)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506) 


You can download the dependency jars from jax-ws website : http://jax-ws.java.net/. Not All files contained in the zipped file will be required for your project. List of required jar files for jax-ws project

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +