SEVERE: Error configuring application listener of class com.sun.xml.ws.transport.http. servlet.WSServletContextListener

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 ….

Above error came when i was trying to setup tomcat 6.x for my project work. The complete environment details are below:

1. Java 6
2. tomcat 6.0

As you can see that the problem is related with the WSServletContextListener Class which is supposed to be present in Java 6 as it supports JAX-WS 2.0.

It works well if you are using tomcat 5.x but not with tomcat 6.x. Lets discuss some class loader changes done in tomcat from version 5.x to 6.x and then we talk about this problem.

So if you need to run web service on tomcat 6.x with Java 6, you need to endorse the new version jars of JAX-WS 2.1. You can download the latest version of JAX-WS from https://jax-ws.dev.java.net/

1. Copy jaxws-api.jar and jaxb-api.jar in /jre/lib/endorsed folder.
2. Place rest of the implementation jar file from JAX-WS’s lib directory in shared.loader path.

Another option which worked for me was that create endorsed folder inside CATALINA_HOME and place api jars there only. I think tomcat just take care of this some how.

After setting up my project using the solution above i had the curiosity about the endorsed feature of Java and tried to know more about it. There exists a Java Endorsed Standards Override Mechanism to update the version of a technology included in the platform to correspond to a later standalone version of that technology (Standalone Technologies).

Read more about it at http://java.sun.com/javase/6/docs/technotes/guides/standards/index.html

Java added implementation of JAX-WS 2.1 in its later updates to avoid the error above so if you are using Java 6 update 4(or older version ) you need the above solution else things will work fine for you.

Most Commented Posts

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Thank You.

This Post was very helful for me. Now all works fine :-)

[...] to Techie Gyan, the following is the problem: “The second change which tells about the cause of the error [...]

Leave a comment

(required)

(required)