web service example does not work with intellij milstone 8.1

Hello, I tried to run the sample Hello World Web Service (JAX-WS). www.jetbrains.com/idea/docs/Web_Services_with_IntelliJ_IDEA.pdf
I get following error, when running the service with SHIFTSTRF10:

What should I do ?

Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class example.jaxws.SayHelloWorldFrom is not found. Have you run APT to generate them?
at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:254)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:550)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:497)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:339)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:225)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:304)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:170)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:91)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at example.HelloWorld.main(HelloWorld.java:25)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

11 comments
Comment actions Permalink

You need to run 'expose class as web service' action first.

Christoph wrote:

Hello, I tried to run the sample Hello World Web Service (JAX-WS). www.jetbrains.com/idea/docs/Web_Services_with_IntelliJ_IDEA.pdf
I get following error, when running the service with SHIFTSTRF10:

What should I do ?

Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class example.jaxws.SayHelloWorldFrom is not found. Have you run APT to generate them?
at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:254)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:550)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:497)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:339)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:225)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:304)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:170)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:91)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at example.HelloWorld.main(HelloWorld.java:25)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:90)



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

I'm having the same problem and the "Expose Class as WebService" did not help.

0
Comment actions Permalink

I'm using the final 8.0 version on Linux and this does not work. Can you please start with a clean install and try the tutorial and tell us what is wrong?

0
Comment actions Permalink

Maxim,

I'm working in IntelliJ IDEA 8.0 build 9013 on an Intel iMac with Mac OS 10.4.11 using JDK 1.5.0_16-132.  I have downloaded and installed Glassfish 9.1 v2 ur2 into a directory under my home so there are no permission problems.  I also executed the ant command as recommended in the Glassfish install in order to create a domain.

I'm having the problems described here.  I point the web services plugin to my installation of Glassfish then create a project and choose the Web Application (2.5) option as well as the WebServices option with the Glassfish/JAX-WS 2.X RI/Metro 1.X/JWSDP 2.0 option.  I rebuild the project, highlight the HelloWorld class, and choose "Expose class as web service."  I then run the main entry point in the HelloWorld class and the stack trace is as shown below.  Any ideas?  I notice that after all this procedure there is no generated class SayHelloWorldFrom in my example.jaxws package, although that package was correctly generated.

Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class example.jaxws.SayHelloWorldFrom is not found. Have you run APT to generate them?
    at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:254)
    at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:550)
    at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:497)
    at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:339)
    at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:225)
    at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:304)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:170)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
    at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
    at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
    at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:91)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:161)
    at example.HelloWorld.main(HelloWorld.java:25)

0
Comment actions Permalink

Maxim, et. al,

I think I've found a workaround that gets the web service working under Glassfish.  I set up the example as above and then execute this procedure:

1) Right-click on HelloWorld and choose Web Services >> Generate Wsdl from Java Code
2) Rename HelloWorldPortType_schema1.xsd to schema1.xsd
3) Right-click on HelloWorld and choose Web Services >> Generate Xml Schema from Java using JAXB
4) Right-click on schema1.xsd and Choose Web Services >> Generate Java Code from Xml Schema using JAXB
5) Make sure the package-prefix is "example" rather than "mypackage".

This seems to generate the "Wrapper" class SayHelloWorldFrom in the right place.  Throughout all of these steps, I was frequently having to rebuild and make the project and click the toolbar's synchronize button.  However, after all this, the main entry point in HelloWorld did run, and I successfully connected to it from a generated web service client also generated for the Glassfish environment.

I hope that 8.1 addresses these issues.  IMHO, this points out serious problems with the web services code generation.

Hopeful for the Future,
Bill

0
Comment actions Permalink

i have the same question,
runtime modeler error: Wrapper class example.jaxws.SayHelloWorldFrom is not found. Have you run APT to generate them?
where is APT?can you tell me ?

0
Comment actions Permalink

Hello.

I have clean installation of IDEA 8.1 (release) on Windows XP and example for JAXWS service still doesn't working. Does anyone know any workarounds for this bug?

0
Comment actions Permalink

Hi,
I think I found the solution for the missing wrapper classes. After all the steps described in the example documentation I did the following:
-  I opened a command line and went to the src folder
- Then you have to execute the following command xjc example\HelloWorldPortType_schema1.xsd. This will generate some java files.
- Now move all the generated java files to the package example.jaxws. There should be ObjectFactory, package-info, SayHelloWorldFrom and SayHelloWorldResponse
- Now build the project and run the Tomcat.

Hope it helps!

0
Comment actions Permalink

Hello,

I tried the above method but it gives me an error that ObjectFactory.java could not be found.

Its little confusing since in your post you said that it will generate this file. But when I run xjc it says system could not find the file ObjectFactory.java!

Please help me with this.

Regards,
Rahul

0
Comment actions Permalink

Apparently, when "Expose Class as WebService" is invoked, the proxy stubs (.class) are being generated in the src folder. If your src folder and compiler output folder is the same it may work. Not sure why this has not been fixed yet.

0
Comment actions Permalink

rahulp wrote:

Hello,

I tried the above method but it gives me an error that ObjectFactory.java could not be found.

Its little confusing since in your post you said that it will generate this file. But when I run xjc it says system could not find the file ObjectFactory.java!

Please help me with this.

Regards,
Rahul


Instead of running xjc, just use 'Expose Class as WebService'.  After invoking it, copy the .class (proxy stubs) files from src folder to your compilation output folder. You should be able to run the webservice. Another way to fix this, is to make your src folder the same as your compilation output folder.

0

Please sign in to leave a comment.