Friday 2 December 2016

java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String

java.lang.NoSuchMethodError



java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String



java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String

If you trying to use JAX-WS 2.2 on top of JDK 6, you run into classloading problems. 

The reason could be using JAX-WS 2.1 on JDK 6. 

JDK 6 (U4 and later) has JAX-WS implementation with JAX-WS 2.1 API. 

If you try to use JAX-WS 2.2, the runtime always picks up the JAX-WS API from boot clasloader and will not see JAX-WS 2.2 API in your classpath.

 Well, the solution is the same, i.e, using the endorsed overriding mechanism.

That I will explain in this post how to do that set up, and resolving the error 


"java.lang.NoSuchMethodError:javax.xml.ws.WebFault.messageName()Ljava/lang/String"


When we run the tomcat we come across the fallowing error as shown below.







How to endorse, required jar files into endorsed folder:

Required jar files:

jaxb-api.jar
jaxws-api.jar


Steps:

1. Go to tomcat home directory

     For example: D:\Applns\apache-tomcat-7.0.23\

2. Create a floder named endorsed in the tomcat home directory.

    After creating the floder endorsed your tomcat endorsed directory structure should as     
    below:

    D:\Applns\apache-tomcat-7.0.23\endorsed\

3. Copy the jaxb-api.jar, jaxws-api.jar to the folder D:\Applns\apache-tomcat-
    7.0.23\endorsed\ 

4. Restart the tomcat server. Error will be resolved and you can able to acces the service.



After copying the jars to the endorsed folder that directory structure will be as shown below:



No comments:

Post a Comment