I am just teaching myself about web services right now and trying to run a helloWorld. I think that to setup all of the web service stuff I need to run apt.
I am running it like this:
apt HelloImpl.java -classpath /<path>/jsr181-api.jar
But I am getting a warning (see below). Do I need to specify an annotation processor too? I think that the apt command is supposed to generate several files but that is not happening (just generating a .class file). Thanks for the help.
Warning:
warning: No annotation processors found but annotations present.
1 warning
Code:
package server;
import javax.jws.WebService;
@WebService
public class HelloImpl {
/**
* @param name
* @return Say hello to the person.
*/
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}
Bonus Question: What does apt do? I assume that it invokes javac? Is it supposed to also invoke a annotation processor?
Update: The tutorial that I am following says:
The next step is to run apt on the above Java code, resulting in several artifacts:
HelloServiceImpl.wsdl
schema1.xsd
classes/server/HelloImpl.class
classes/server/jaxrpc/SayHello.class
classes/server/jaxrpc/SayHelloResponse.class
classes/server/jaxrpc/SayHello.java
classes/server/jaxrpc/SayHelloResponse.java
I think that this is what apt should be producing (assuming that I pass it the correct arguments). However I think that I need to pass it an annotation processor(?). I would really just like to use the default (web services annotation processor) though.
Update 2: Maybe I should be using asant or wsgen? I looked but I don t have either of these on my machine.. Something to look into.. Maybe the tutorial I am/was using is wrong. Here is a link to the asant reference: http://java.sun.com/webservices/docs/2.0/tutorial/doc/JAXWS3.html