deploy jax-ws or metro web services on tomcat server

When deploy jax-ws application on tomcat you maybe get this issue

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodError: javax.xml.ws.soap.Addressing.responses()Ljavax/xml/ws/soap/AddressingFeature$Responses;
java.lang.NoSuchMethodError: javax.xml.ws.soap.Addressing.responses()Ljavax/xml/ws/soap/AddressingFeature$Responses;

This error occur cause the version JAXWS we use difference with the version JAX-WS ship with java. We can check version ship with java by run wsimport

in $JAVA_HOME/bin by follow command:

wsimport -version

So solution you can using wsimport or wsgen ship with java version to build web service or web service client.
But what happend if you still want using new version JAX-WS?
Well let me show you solution. The answer for that is using the endorsed overriding mechanism.
This guide will help you on Tomcat 6 and 7.

  • Create folderĀ endorsed in $CATALINA_HOME
  • Copy following file in $JAXWS_HOME/lib jax-ws.api.jar,jaxb-api.jar,webservices-api.jar into endorsed

With above change your tomcat will work well with version JAX-WS that you want.
If it still not work so that must has problem on tomcat’s startup script(linux/unix). In that case you must add following parameter into startup script(linux/unix) in JAVA_OPTS parameters

 export JAVA_OPTS="$JAVA_OPTS" -Djava.endorsed.dirs="path of endoresed folder"

Leave a Reply