WebservicesPlugin poblem

Hi,

when deploying class as webservice I get this error in dialog window:

Problem encountered during annotation processing;
see stacktrace below for more information.
java.lang.NoClassDefFoundError: com/sun/mirror/type/ArrayType
at com.sun.istack.tools.APTTypeVisitor.apply(APTTypeVisitor.java:22)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.getSafeType(WebServiceWrapperGenerator.java:375)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.collectMembers(WebServiceWrapperGenerator.java:329)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.generateWrappers(WebServiceWrapperGenerator.java:283)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.processMethod(WebServiceWrapperGenerator.java:146)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitMethodDeclaration(WebServiceVisitor.java:470)
at com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl.accept(MethodDeclarationImpl.java:41)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.processMethods(WebServiceVisitor.java:408)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.postProcessWebService(WebServiceVisitor.java:363)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.postProcessWebService(WebServiceWrapperGenerator.java:121)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:169)
at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:347)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:232)
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:448)
at com.sun.tools.apt.main.Main.compile(Main.java:1075)
at com.sun.tools.apt.main.Main.compile(Main.java:938)
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.ws.wscompile.CompileTool.buildModel(CompileTool.java:605)
at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:538)
at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:56)
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:585)
at com.sun.tools.ws.Invoker.main(Invoker.java:63)
at com.sun.tools.ws.WsGen.main(WsGen.java:30)

Configuration:
Linux
JDK 5
IDEA 6.0.4
WebservicesPlugin 0.7 build1
Glassfish

Thank you.

25 comments
Comment actions Permalink

Thank you, will fix in next refresh release.
As work around you can add tools.jar from JDK to the web module classpath (as nondeployable library)

0
Comment actions Permalink

Sorry, but the problem still remains...neither JDK6 didn't solve it :(

0
Comment actions Permalink

Ok, could you please name your Glassfish version and JAX-WS implementation used. I've tested with JEE5 and GlassFish_v2.

0
Comment actions Permalink

JEE 5, Java System Application Server Platform Edition 9.0 Update 1 (this is built out of GlassFish v1 ur1 p01 build 02 )

0
Comment actions Permalink

And 'Path to Glassfish/JAXWS-RI/JWSDP' in WebServices plugin settings points to Glassfish? I saw this problem when stand alone JWSDP2 / JAXWS-RI2 was used...

0
Comment actions Permalink

Path to Glassfish: /home/user/Programs/SJSAS9.1

0
Comment actions Permalink

I don't know whether there could be any connection but everytime I open some jsp file (maybe not only in this case) i get this:

No message
java.lang.NullPointerException
at com.intellij.codeInsight.AnnotationUtil.findAnnotation(AnnotationUtil.java:73)
at com.advancedtools.webservices.highlighting.WSHighlighter.suitableForFile(Unknown Source)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:193)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:146)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:59)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:6)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:82)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:26)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:25)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:88)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:38)



java.lang.NullPointerException
at com.intellij.codeInsight.AnnotationUtil.findAnnotation(AnnotationUtil.java:73)
at com.advancedtools.webservices.highlighting.WSHighlighter.suitableForFile(Unknown Source)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:193)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:146)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:59)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:6)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:82)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:26)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:25)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:2)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:88)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:38)


This message appers during my work 50 times in hour...

0
Comment actions Permalink

Thank you, NPE is fixed.

0
Comment actions Permalink

Could you please try updated version of the plugin, please, post again if problems persist

0
Comment actions Permalink

Wow, it seems to run fine, thank you.

No errors appeared but after deploying to SJSAS there's no webservices available.
I'm including war file just to be sure that I'm doing something wrong, not the plugin.

And one more exception appeared, after clicking "Enable WS support" for the first time (then it's ok).

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(188,150),button=1,modifiers=Button1,clickCount=1] on dialog1
java.lang.NullPointerException
at com.advancedtools.webservices.utils.int.super(Unknown Source)
at com.advancedtools.webservices.utils.int.access$000(Unknown Source)
at com.advancedtools.webservices.utils.int$3.run(Unknown Source)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:402)
at com.advancedtools.webservices.utils.int.super(Unknown Source)
at com.advancedtools.webservices.utils.int.super(Unknown Source)
at com.advancedtools.webservices.utils.int.super(Unknown Source)
at com.advancedtools.webservices.actions.EnableWebServicesSupportAction.o00000(Unknown Source)
at com.advancedtools.webservices.actions.EnableWebServicesSupportAction.access$000(Unknown Source)
at com.advancedtools.webservices.actions.EnableWebServicesSupportAction$1.run(Unknown Source)
at com.advancedtools.webservices.utils.super.new.doOKAction(Unknown Source)
at com.advancedtools.webservices.actions.o0OO.doOKAction(Unknown Source)
at com.intellij.openapi.ui.DialogWrapper$OkAction.actionPerformed(DialogWrapper.java:856)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:8)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:42)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:73)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)



Attachment(s):
mojews.war
0
Comment actions Permalink

In sun-web.xml you need to add 'context-root' tag with appropriate value. Result
sun-web.xml looks like following text:
-


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN"
"http://www.sun.com/software/dtd/appserver/sun-web-app_2_5-0.dtd">
<sun-web-app>
<context-root>/myservice2</context-root>
</sun-web-app>
-


0
Comment actions Permalink

I've change it but it still doesn't work:

http://localhost:8080/myservice2/services/Hello gives 404

I also wonder why hello.jaxws.SayHello and SayHelloResponse aren't icluded in the war file.
There's no wsdl file in archive and webservice doesn't appear in webservices menu in SJSAS

I did everything after this tutorial http://weblogs.java.net/blog/arungupta/ and after help in webservicesplugin tab (including File->Synchronize)

Thank you

0
Comment actions Permalink

Argh, please add ?*.class to compiler resources (JAXWS from some version does generate class file and I fixed it for Glassfish v.2)
Default wsdl is generated from java class.

0
Comment actions Permalink

I still don't get it...

I create web module, create hello.Hello class with annotations, press Enable WS..., compile this class, press Deploy as WS, set context-root, run glassfish configuration...

After that process In the war file there is only web.xml, sun-web.xml, sun-jaxws.xml and Hello class so I don't see the effect of "Deploy as WS".

What do I need to do to be able to see Hello in the list of webservices in glassfish? Putting jaxws.SayHello[Response] to webapplication in glassfish didn't changed anything.

thank you

0
Comment actions Permalink

Well, after many f*****g hours I found out what was wrong.

Why the heck IDEA generates by default deployment descriptor of version 2.4? And why no tutorial points out that one should switch to version 2.5 to get WS working? :-/ (I hope that it wasn't me who changed to 2.4, unwittingly)

Now it's working but I'd like to ask you once more what is the puropose of SayHello and SayHelloResponse classes. There are in src/jaxws package (compiled) and it seems they are not needed.
Java EE tutorial doesn't mention them.

Thank you

0
Comment actions Permalink

One can set deployment descriptor version during initial module creation (after setting once it is remembered and setting 2.5 automatically adds javaee.jar to classpath, still 2.5 is not common among servlet containers, e.g. Tomcat is not support it yet).
The classes are needed to serialize and deserialize xml SOAP messages to/from java objects, default wsdl also seems to be generated from these classes. JavaEE tutorial does not mention the classes because they are created during deployment. However, they are still needed during development of the service.
I will update the web services doc and post the details to Arun Gupta web blog.
Thank you for the feedback.

0
Comment actions Permalink

AFAIU, GlassFish (as Weblogic, etc) will show explicit WebService iff there is existing ejb (ejb container) that is exposed as web service. The plugin supports lighter (web container based) web services.

0
Comment actions Permalink

However, they are
still needed during development of the service.


So
- should I leave them in the folder with source files (just to be sure:it's not bug, they should have been generated and placed in src/jaxws)?
- and should I pack them to the war file?

=============
Last thing (I hope):

This client application (from Arun Gupta blog) runs fine:

public class HelloClient {
public static void main(String[] args) {
System.out.println(new HelloService().getHelloPort().sayHello("Duke"));
}
}

@WebServiceClient(name = "HelloService", targetNamespace = "http://hello/", wsdlLocation = "http://localhost:8080/WebApplication4/services/Hello?wsdl")
public class HelloService extends Service {
......
}

but the one from JavaEE tutorial not ('service' is null I guess):

@WebServiceRef(wsdlLocation = "http://localhost:8080/WebApplication4/services/Hello?wsdl")
static HelloService service;

public static void main(String[] args) {
System.out.println(service.getHelloPort().sayHello("Duke"));
}

Thank you

0
Comment actions Permalink

Well I fixed this problem by installing Glassfish v2 (two generated classes are correctly bundled to war file and deployed).

Could you fix it also for Glassfish v1, please...?

....(because I'm little reserved when Glassfish v2 gives 404 at http://localhost:8080/WSProject/services/Hello -- after applying the same steps as with Glassfish v1

/WSProject]]>
)

Thank you

0
Comment actions Permalink

These files are needed during any web service call, I've updated WebServices plugin to always add '?*.class' to compiler resource pattern so when IDEA builds application then these files go to war file automatically (I am keen to provide better experience with such generated artifcats though).
Does the problem with web service client is the last one you have?

0
Comment actions Permalink

Now it seems that I'm be able to develop with JAX-WS.
But please release the updated version so that I can develop under Glassfish v1 too.

If I find another problem with the plugin I'll post it here.

Thank you for perfect support.

0
Comment actions Permalink

Updated plugin (I had put it another time tonight) works with JEE5_u2 on Windows
Could you please describe what problems you have with Glassfish v1?
Note, iff web app is failed to deploy e.g. due to nonunique context then service is not available (check the status in console) also server gives 404 when incorrect web service name is specified

0
Comment actions Permalink

If you modified compiler resource patterns manually then you should get the generated classes in war file after rebuild

0
Comment actions Permalink

The yesterday build solved the "tools.jar" problem.

But the "jaxws/Hello.class and jaxws/HelloResponse.class problem" still remains on Glassfish v1 (as you said you patched it for Glassfish v2 and there it works for me). These files aren't included in war file...so I can't build WS client. See your post starting with "Argh..."

0
Comment actions Permalink

I've reissued the 0.7.2 again tonight without advancing build number (you will need to redo expose the class and rebuild)

0

Please sign in to leave a comment.