File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Unable to generate war file using jwsc task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Unable to generate war file using jwsc task" Watch "Unable to generate war file using jwsc task" New topic
Author

Unable to generate war file using jwsc task

jagan raja
Ranch Hand

Joined: Jan 29, 2010
Posts: 54
Hi All,

I am trying to create a webservice using bottom up approach.

So, I gave the implementation file as input to jwsc task and executed the ant script.

The war file is generated and the build script din't throw any errors.

The warnings which were thrown were,

[jwsc] warning: Specified AnnotationProcessorFactory, 'com.sun.istack.ws.AnnotationProcessorFactoryImpl', not found on search path.
[jwsc] warning: No annotation processors found but annotations present.


The build script gives me only the implementation class. The artifacts are not generated.

I am using weblogic jar for jwsc task. I tried with wsgen from command prompt and got the below error,

Problem encountered during annotation processing;
see stacktrace below for more information.
java.lang.NullPointerException
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.isLegalType(WebServiceVisitor.java:770)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.isLegalMethod(WebServiceVisitor.java:618)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.methodsAreLegal(WebServiceVisitor.java:588)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.isLegalImplementation(WebServiceVisitor.java:506)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.shouldProcessWebService(WebServiceVisitor.java:309)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisi
tor.visitClassDeclaration(WebServiceVisitor.java:112)
at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(Clas
sDeclarationImpl.java:95)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.b
uildModel(WebServiceAP.java:315)
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.p
rocess(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.ja
va: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(DelegatingMethodAcces
sorImpl.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


With the weblogic server running and using eclipse I was able to generate those artifacts, but not with ant build or using wsgen.

Please help me out if I have missed out something.

Thanks.
jagan raja
Ranch Hand

Joined: Jan 29, 2010
Posts: 54
Hi All,

Just to add info.

I googled out and tried out the "apt -XPrintFactoryInfo -XPrintAptRounds -XListAnnotationTypes <mypackage/implementation_file.java>" and it generated all the artifacts as java files in the package mypackage.jaxws.

I am not able to figure out whats happening.

I am trying to get the exact classes(artifacts) using my build script as i mentioned above.

Thanks in advance.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

Have you looked at here?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
jagan raja
Ranch Hand

Joined: Jan 29, 2010
Posts: 54
Hi Vijitha,

I have gone through that link a lot number of times.

The top down aproach works fine for me, wsdlc task generates the necessary artifacts into a jar file.

The problem is when I try the bottom up approach.

Eclipse makes everything easier, I created the java file in a webservice project included it into the ear project and gave run on server which creates those artifacts automatically in the build folder.Also, I am not able to figure out how eclipse creates those classes.

But not while using the build script(jwsc task). Jwsc task creates a war file with deployment descriptors and the implementation class.

How do I generate the Request, Response classes which eclipse creates by default when run on server?

Thanks
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

Can you show your Ant snippet related to this?
jagan raja
Ranch Hand

Joined: Jan 29, 2010
Posts: 54
Hi Vijitha,

Please find the build snippet,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to generate war file using jwsc task