6 Replies Latest reply on Jun 23, 2009 7:12 PM by Peter Johnson

    Not able to generate the wsdl

    Rishi Jena Newbie

      Hi,
      I am pretty new to jbossws. I am trying to expose my ejb as webservices and have been try a very trivial example for test. I can register the endpoint but does not generate the wsdl file.

      this is the basic service I am trying to test on.

      @Stateless
      @WebService(name = "additionService", serviceName = "additionService", targetNamespace = "http://eardeployment.jaxws/")
      //@SOAPBinding(style = SOAPBinding.Style.RPC)
      @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
      @WebContext(contextRoot = "/test")
      public class Addition {

      @WebMethod(operationName = "add")
      public int add(@WebParam(name = "i") int i, @WebParam(name = "j") int j) {
      int k = i + j;
      return k;
      }
      }

      The ERRORS that I get are :

      javax.servlet.ServletException: Servlet.init() for servlet Addition threw exception
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      java.lang.Thread.run(Thread.java:595)

      root cause

      java.lang.ClassCastException: org.jboss.wsf.framework.DefaultSPIProviderResolver
      org.jboss.wsf.spi.SPIProviderResolver.getInstance(SPIProviderResolver.java:38)
      org.jboss.wsf.stack.jbws.EndpointServlet.init(EndpointServlet.java:68)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      java.lang.Thread.run(Thread.java:595)

      Any help in providing some enlightenment will be greatly appreciated.

      Thanks,
      RJ

        • 1. Re: Not able to generate the wsdl
          Peter Johnson Master

          Hmm, you're using a lot more annotations than I used for a simple service. See here for a complete example: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4182251 Try using the minimal number of annotations (and annotation attributes) first and see if that works. If so, then the issue is with one of the annotations.

          Also, the stack trace you posted appears to be what is shown in the browser. There should also be an exception in the console log - could you post that?

          • 2. Re: Not able to generate the wsdl
            Rishi Jena Newbie

            Peter,
            I tried using the example you have mentioned but I still get the errors. The errors that is in the console log.

            13:28:33,507 ERROR [[/hello]] StandardWrapper.Throwable
            java.lang.ClassCastException: org.jboss.wsf.framework.DefaultSPIProviderResolver
            at org.jboss.wsf.spi.SPIProviderResolver.getInstance(SPIProviderResolver.java:38)
            at org.jboss.wsf.stack.jbws.EndpointServlet.init(EndpointServlet.java:68)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
            at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            at java.lang.Thread.run(Thread.java:595)
            13:28:33,507 ERROR [[HelloService]] Allocate exception for servlet HelloService
            java.lang.ClassCastException: org.jboss.wsf.framework.DefaultSPIProviderResolver
            at org.jboss.wsf.spi.SPIProviderResolver.getInstance(SPIProviderResolver.java:38)
            at org.jboss.wsf.stack.jbws.EndpointServlet.init(EndpointServlet.java:68)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
            at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
            at java.lang.Thread.run(Thread.java:595)

            Thanks in advance.
            RJ

            • 3. Re: Not able to generate the wsdl
              Peter Johnson Master

              What version of JBoss AS are you using? Did you compile your web service using the JARs from that same version?

              • 4. Re: Not able to generate the wsdl
                Rishi Jena Newbie

                Peter,
                I am using jboss 4.2.3 ga.

                Thanks,
                RJ

                • 5. Re: Not able to generate the wsdl
                  Rishi Jena Newbie

                  yes the jars are from the same version.

                  • 6. Re: Not able to generate the wsdl
                    Peter Johnson Master

                    I copied your code, as is, into one of my web service classes, compiled and deployed to AS 4.2.3, and I get the WSDL without any problems.

                    So now the question is how is your web service different from mine. I assume you are packaging it as a JAR file - could you post the JAR file contents. You can get that by running "jar -tf xxx.jar" where xxx.jar is the name of your JAR file.