T.A. Otero Lojo
T.A. Otero Lojo

Reputation: 31

Error generating WSDL in Netbeans

I'm novice using Netbeans and I was trying to test how works WDSL generation.

I created a basic web service and when tried to generate the WDSL the following error occurs:

Error starting wsgen: class com.sun.tools.javac.api.JavacTool BUILD FAILED (total time: 2 seconds)

This is the code, very basic:

package ServiciosWeb;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

@WebService(serviceName = "Cajero")
public class Cajero {

    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
    }
}

I googled the error message but only could obtain obscure explanations, none of them aplicable to this. Any advice about the meaning of this message and how to avoid it?

Upvotes: 2

Views: 4227

Answers (2)

jccan
jccan

Reputation: 11

I had the same problem and applied the same solution for NetBeans 8.2 on Windows 7.

I copied the wrong statement from the console, I put an space between "wsegn" and their argument, and it worked!

Wrong statement: wsgen"C:\Program Files Corrected statement: wsgen "C:\Program Files

Upvotes: 1

T.A. Otero Lojo
T.A. Otero Lojo

Reputation: 31

Finally I think I found the answer to this problem. It looks like there is an error related with the version 8.2 of Netbeans.

Apparently the default setting of ant is incorrect and this causes that a space separator was missed in the invocation of wsgen. And this is what I think was causing the error.

Since I still don't know how to set up the IDE version of ant, I copied the wrong statement from the output window and once fixed the problem of the spaces, I executed it from the command line. Everything went well this time.

Upvotes: 1

Related Questions