1. Discover problems
The JAX-WS specification is a JAVA API for a set of XML web services. JAXWS-RI is one of its packages.
Use jaxws-ri-2.2. to make a webservice, copy the lib content in jaxws-ri-2.2. into the lib of the web project. When running, throw an exception when using the package: () Ljava/lang/String.
2. Cause analysis
The JAXWS-RI package uses a WebFault object, and the JDK also provides this object, but the JDK's WebFault object does not have the messageName method. Tomcat will prioritize loading of the objects in the JDK, which is the package conflict problem.
This requires aendorsedFolder. It can be understood that the package repair in the endorsed folder is inserted into the startup API specified by the virtual machine and replaced it. However, there are limited classes that can be overwritten, such as not including classes in packages. For example, the package in the endorsed folder created by jdk\jre\lib will overwrite the original package in the JDK lib. The Webfault object in Tomcat also conflicts with JAXWS-RI. Therefore, you need to create a new endorsed folder in both JDK and Tomcat and put it in the relevant packages in JAXWS-RI.
3. Solution
Step 1: Copy the package to jre\lib\endorsed in jdk
Step 2: Copy the package into tomcat\endorsed
If there is no endorsed folder, just create a new one. jaxws-ri.2.5.5 download address:/download/woshixuye/6513149