Solving JAX-WS problems on Tomcat 7

When running JAX-WS applications on Apache Tomcat 7 you might encounter the following exception:

java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
	at com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1077)

To solve this add the webservices-api-x.y.jar to the CATALINA_HOME/endorsed directory.

Do NOT add the webservice-rt-x.y.jar to the endorsed directory or you will encounter the following exception:

java.lang.NoClassDefFoundError: javax/servlet/ServletContext
	at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.<init>(WSServletDelegate.java:102)

Leave a Reply