Topic
  • 6 replies
  • Latest Post - ‏2012-10-09T03:19:53Z by X75J_Li_Yanli
warpman666
warpman666
9 Posts

Pinned topic "Unable to generate WSDL 1.1 for this service" error - annotated POJO

‏2012-09-07T12:27:35Z |
Hello all,

Using the following tools:

WASCE 3.0.0.1
Axis2 1.6.1
Eclipse - Latest release with WASCE plugin
Windows 7 Professionnal

A colleague of mine is trying to expose a simple web service, using an annotated POJO. He is experiencing the following issues.

POJO sample:

package testPojo;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class Hello{
@WebMethod(operationName = "sayHello")
public String sayHello(String targetName){
return "Hello "+targetName;
}
}

Once deployed on WASCE, the service is correctly listed in the services list and the generated wsdl, version 2, is reachable:

http://localhost:8080/testPojo/services/HelloService?wsdl2
http://localhost:8080/testPojo/services/listServices

The problem is the generated wsdl (original version, using http://localhost:8080/testPojo/services/HelloService?wsdl) is unreacheable, leading to the following stack trace in the browser.

<error><description>Unable to generate WSDL 1.1 for this service</description><reason>If you wish Axis2 to automatically generate the WSDL 1.1, then please set useOriginalwsdl as false in your services.xml</reason>javax.xml.ws.WebServiceException: Error occurred generating WSDL file for Web service implementation class {testPojo.Hello}
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:198)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:390)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:383)
at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1394)
at org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAgent.java:327)
at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:183)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:820)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:48)
at org.apache.geronimo.tomcat.valve.ProtectedTargetValve.invoke(ProtectedTargetValve.java:53)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:243)
at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:373)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.ws.spi.WSToolsObjectFactory
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:177)
... 28 more
</error>

Also getting the following stack trace in Eclipse:

2012-09-06 14:03:49,864 ERROR JAXWSRIWSDLGenerator Error occurred generating WSDL file for Web service implementation class {testPojo.Hello}
java.lang.ClassNotFoundException: com.sun.tools.ws.spi.WSToolsObjectFactory
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:177)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:390)
at org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:383)
at org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1394)
at org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAgent.java:327)
at org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:183)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:820)
at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:48)
at org.apache.geronimo.tomcat.valve.ProtectedTargetValve.invoke(ProtectedTargetValve.java:53)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:243)
at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:373)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Has anyone encountered this before? If so, how can this be solved?

Any input will be deeply appreciated, thanks in advance!

  • bb

PS: We did experiment with the useOriginalwsdl flag, but with no success.
Updated on 2012-10-09T03:19:53Z at 2012-10-09T03:19:53Z by X75J_Li_Yanli
  • warpman666
    warpman666
    9 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-09-10T19:10:14Z  
    Bumping this thread... anyone?
  • Shawn_Jiang
    Shawn_Jiang
    154 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-09-11T01:16:10Z  
    Bumping this thread... anyone?
    If you are shipping axis2 in your application to support jaxws, you can disable the geronimo built-in jaxws support by adding

    GERONIMO_OPTS = -Dorg.apache.geronimo.jaxws.support=true

    and then start the geronimo.
  • warpman666
    warpman666
    9 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-09-17T16:40:54Z  
    If you are shipping axis2 in your application to support jaxws, you can disable the geronimo built-in jaxws support by adding

    GERONIMO_OPTS = -Dorg.apache.geronimo.jaxws.support=true

    and then start the geronimo.
    Hi Shawn, thanks again for you input.

    We have tried this option and apparently, this does not solve the issue we are having.

    Any other ideas?
  • Shawn_Jiang
    Shawn_Jiang
    154 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-09-18T05:13:24Z  
    Hi Shawn, thanks again for you input.

    We have tried this option and apparently, this does not solve the issue we are having.

    Any other ideas?
    I'm sorry, I meant

    GERONIMO_OPTS = -Dorg.apache.geronimo.jaxws.support=*false*

    to disable WASCE built-in jaxws support. If it does not work, please provide more specific info on your use case. we'd like to know what's the structure of your application. It would be better if you can upload the app so that we can recreate it easily.
  • warpman666
    warpman666
    9 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-09-19T16:50:00Z  
    I'm sorry, I meant

    GERONIMO_OPTS = -Dorg.apache.geronimo.jaxws.support=*false*

    to disable WASCE built-in jaxws support. If it does not work, please provide more specific info on your use case. we'd like to know what's the structure of your application. It would be better if you can upload the app so that we can recreate it easily.
    Shawn, thanks again for your comments. Please find attached a zip file of a test project that my colleague assembled for me.

    Again, thanks for your time.
  • X75J_Li_Yanli
    X75J_Li_Yanli
    45 Posts

    Re: "Unable to generate WSDL 1.1 for this service" error - annotated POJO

    ‏2012-10-09T03:19:53Z  
    Shawn, thanks again for your comments. Please find attached a zip file of a test project that my colleague assembled for me.

    Again, thanks for your time.
    Hello,

    From the attached application appli_test.zip, deployed the WSTestEAR.ear, the right url to access the application is:

    http://localhost:8080/WSTest/HelloBillService

    and the url to get the WSDL file is :

    http://localhost:8080/WSTest/HelloBillService?WSDL