Grizzly - java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName

后端 未结 6 1610
滥情空心
滥情空心 2021-01-05 10:17

I have a wsdl file for the Web service. I want to test the interaction between the client and the server. To do this, I run the mock server with embedded grizzly.

Th

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-05 10:29

    Your version of Grizzly expects a JAX-WS 2.2 API while JDK 1.6 ships with JAX-WS 2.1. As others mentioned, some of these files need to be installed into an endorsed directory. You can download the required files here or take them from your Grizzly installation. The download includes an Ant build file that provides a build target to install the files into the JDK endorsed directory. You can run it with ant install-api. If you cannot run Ant, you may install them manually:

    cp lib/jaxb-api.jar $JAVA_HOME/lib/endorsed
    cp lib/jaxws-api.jar $JAVA_HOME/lib/endorsed
    

    Do not install other files from the JAX-WS distribution into the endorsed directory unless you want to create some really difficult to debug bugs for yourself.

    I am suggesting to use the endorsed directory in $JAVA_HOME/lib/endorsed because that will work with most tools and applications without any additional changes. Others already suggested more targeted changes, such as setting an endorsed directory during a Maven build or copying the files into a Tomcat endorsed directory. All these approaches are fine as long as you can make sure that your code is picking up the right endorsed directory.

提交回复
热议问题