Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

The question about of implementing mock server. I generated an interface from wsdl (and xsd) using the wsimport and wrote implementation. When run on the grizzly, I get the following error:

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

I run a web service with this code:

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

The problem is that Grizzly can not find wsdl and xsd files. In embedded glassfish its work.

EDIT1

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

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

EDIT2

If use JDK1.7 it works. But I need a JDK 1.6

like image 616
Anton Tsivarev Avatar asked Nov 13 '12 06:11

Anton Tsivarev


2 Answers

I'm not sure why you're seeing that error. I can run the Grizzly jaxws example and obtain the wsdl using either 1.6 or 1.7.

I would recommend reviewing the source1 of the example and compare to what you have.

like image 66
rlubke Avatar answered Sep 19 '22 08:09

rlubke


I'm change the jdk6 to jdk7 and works fine! Don't forget to change the JAVA_HOME and the default JDK of Netbeans as related here: How to set the JDK Netbeans runs on?

like image 43
dellasavia Avatar answered Sep 23 '22 08:09

dellasavia