views:

405

answers:

1

I'm creating a webservice using JAX-WS's (JSR 224's) @WebService and @WebMethod annotations. Although I've found the specification, I can't find the limitations I'm running into documented anywhere.

Here's what I've stumbled across so far using JAX-WS 2.1.6 provided with JDK 6:

  • You cannot use interfaces as parameters, return values, or object members
  • All classes must provide a no-args default constructor

What are the limitations of wsgen? Which constructs should I avoid?

I've also stumbled across some odd errors, all of which seem similar to the following, and which may be a bug:

Note:   ap round: 1
Problem encountered during annotation processing; 
see stacktrace below for more information.
java.lang.NullPointerException
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalType(WebServiceVisitor.java:770)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalMethod(WebServiceVisitor.java:618)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.methodsAreLegal(WebServiceVisitor.java:588)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalImplementation(WebServiceVisitor.java:506)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessWebService(WebServiceVisitor.java:309)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:112)
        at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:315)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:256)
        at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
        at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
        at com.sun.tools.apt.main.Main.compile(Main.java:1102)
        at com.sun.tools.apt.main.Main.compile(Main.java:964)
        at com.sun.tools.apt.Main.processing(Main.java:95)
        at com.sun.tools.apt.Main.process(Main.java:85)
        at com.sun.tools.apt.Main.process(Main.java:67)
        at com.sun.tools.internal.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:204)
        at com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:105)
        at com.sun.tools.internal.ws.WsGen.main(WsGen.java:41)
error: compilation failed, errors should have been reported
A: 

See if this helps for odd errors (I solved my error similar to yours with appropriate classpath setting) : http://eskatos.wordpress.com/2007/10/16/glassfish-hibernate-and-webservices-wsgen-classpath/

draganstankovic