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

I have a wsdl file for a web service. I want to check the interaction between the client and server. To do this, I run a server layout with a built-in grizzly.

Question about the implementation of the breadboard server. I created an interface from wsdl (and xsd) using wsimport and wrote an implementation. When running on a grizzly, I get the following error:

com.sun.xml.ws.server.ServerRtException: [failed to localize] cannot.load.wsdl(META-INF/wsdl/test.wsdl) 

I am starting a web service with this code:

  HttpHandler httpHandler = new JaxwsHandler(new TestImpl()); server.getServerConfiguration().addHttpHandler(httpHandler, "/test"); 

The problem is that Grizzly cannot find the wsdl and xsd files. In the integrated glass layer of his work.

EDIT1

I change wsdlLocation to "test.wsdl" and its work. But now the grizzlies say:

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

EDIT2

If using JDK1.7, it works. But I need JDK 1.6

+7
source share
6 answers

As a result, we had to use an approved mechanism. Documentation

0
source

I am not sure why you see this error. I can run the Jazzs Grizzly example and get wsdl using either 1.6 or 1.7.

I would recommend looking at the source of 1 example and comparing it with what you have.

+1
source

I am changing jdk6 to jdk7 and working great! Remember to change the default JAVA_HOME and JDK for Netbeans as described here: How to configure Netbeans JBK on?

+1
source

Your Grizzly version expects the JAX-WS 2.2 API, while JDK 1.6 ships with JAX-WS 2.1. As already mentioned, some of these files must be installed in an approved directory. You can download the necessary files here or take them from your Grizzly installation. The download includes an Ant build file, which provides a build target for installing files in a JDK-enabled directory. You can run it with ant install-api . If you cannot run Ant, you can 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 in an approved directory unless you want to create some of the very difficult to debug errors for yourself.

I suggest using the approved directory in $ JAVA_HOME / lib / if it will work with most tools and applications without any further changes. Others have already suggested more targeted changes, such as installing an approved directory during Maven build or copying files to a Tomcat approved directory. All of these approaches are great as long as you can make sure your code picks the right directory.

+1
source

create a folder called endorsed and put these files in it jar 1.jaxb-api-2.2.jar 2.jaxws-api.jar put the folder on the tomcat server as C: \ -7.50 cat \ <created folder> and it will start working

0
source

Changing the JDK from 1.6 to 1.7 worked for me.

0
source

All Articles