3 Replies Latest reply on Apr 6, 2006 8:14 AM by fss

    Need help debugging web service deployment

    bbell2000

      I'm using JBoss 4.0.3SP1. I have to do a top-down implementation so I used the JAXB+JAXRPC method described at http://www.develop.com/us/downloads/SchemaDriven.pdf.

      My WSDL's service element looks like this:

      <service name="TestService">
       <port name="TestServicePort" binding="uc:TestServiceSoapBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
      </service>
      


      The rest of the WSDL is valid (according to XMLSpy), and both xjc and wscompile run without a hitch. I used the -nv, -extension, -xmlschema, -b, and -d flags for xjc and the -import, -f:wsi, -f:nodatabinding, -d, -s and -mapping flags for wscompile. Everything builds.

      My web.xml looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
       version="2.4">
      
       <servlet>
       <servlet-name>TestService</servlet-name>
       <servlet-class>com.example.wsapi.TestServicePort_Impl</servlet-class>
       </servlet>
      
       <servlet-mapping>
       <servlet-name>TestService</servlet-name>
       <url-pattern>/TestService</url-pattern>
       </servlet-mapping>
      
      </web-app>
      


      And my webservices.xml looks like this:

      <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
       version="1.1">
       <webservice-description>
       <webservice-description-name>TestService</webservice-description-name>
       <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
       <jaxrpc-mapping-file>WEB-INF/test-service-mapping.xml</jaxrpc-mapping-file>
       <port-component>
       <port-component-name>TestService</port-component-name>
       <wsdl-port>TestServicePort</wsdl-port>
       <service-endpoint-interface>com.example.wsapi.TestServicePort</service-endpoint-interface>
       <service-impl-bean>
       <servlet-link>TestService</servlet-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
      </webservices>
      


      I changed log4j.xml to do DEBUG level logging for org.jboss, org.jboss.axis and my application. There are no errors in the log, but there is also no indication that my service was deployed. When I browse to http://localhost/ws4ee/services, my WSDL is not listed. I have another web application that was deployed in the same .ear and it works just fine.

      What else should I be checking for?



        • 1. Re: Need help debugging web service deployment
          bbell2000

          I managed to get past the initial problem. The web service is being deployed.

          However, when I browse to http://localhost/ws4ee and click on the View link, I get the following error:

          java.lang.IllegalArgumentException: Illegal argument passed to ParameterDesc.setJavaType. The java type javax.xml.soap.SOAPElement does not match the mode inout


          The log says:

          2006-01-13 15:03:21,857 DEBUG [org.jboss.axis.description.ServiceDesc] Converting param: interface javax.xml.soap.SOAPElement
          2006-01-13 15:03:21,857 DEBUG [org.jboss.axis.description.ServiceDesc] Setting param class: interface javax.xml.soap.SOAPElement
          2006-01-13 15:03:21,857 INFO [org.jboss.axis.transport.http.AxisServlet] Exception:
          java.lang.IllegalArgumentException: Illegal argument passed to ParameterDesc.setJavaType. The java type javax.xml.soap.SOAPElement does not match the mode inout
           at org.jboss.axis.description.ParameterDesc.setJavaType(ParameterDesc.java:269)
           at org.jboss.axis.description.ServiceDesc.syncOperationToClass(ServiceDesc.java:753)
           at org.jboss.axis.description.ServiceDesc.getSyncedOperationsForName(ServiceDesc.java:1187)
           at org.jboss.axis.description.ServiceDesc.loadServiceDescByIntrospectionRecursive(ServiceDesc.java:1045)
           at org.jboss.axis.description.ServiceDesc.loadServiceDescByIntrospection(ServiceDesc.java:972)
           at org.jboss.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:732)
           at org.jboss.webservice.server.InvokerProvider.initServiceDesc(InvokerProvider.java:106)
           at org.jboss.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:388)
           at org.jboss.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:560)
           at org.jboss.axis.deployment.wsdd.WSDDDeployment.getDeployedServices(WSDDDeployment.java:617)
           at org.jboss.axis.configuration.FileProvider.getDeployedServices(FileProvider.java:356)
           at org.jboss.webservice.server.AbstractServlet.reportAvailableServices(AbstractServlet.java:94)
           at org.jboss.webservice.server.ServiceEndpointServlet.doGet(ServiceEndpointServlet.java:69)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
           at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase.java:370)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
           at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
           at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
           at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
           at java.lang.Thread.run(Thread.java:595)
          


          • 2. Re: Need help debugging web service deployment
            kyle.d.duncan

            I don't have an answer for your current problem, but if you get past it I'd be very interested to know whether you can get the web service to work.

            I tried to use the suggestions from SchemaDriven.pdf to write a webservice using JAXB and ran into a serious problem.
            I was using JAXB 1.0.1, and J2SDK 1.4.2, and any time I tried to marshal into any kind of org.w3c.dom.Node (such as a SoapElement), I would get a Null Pointer Exception. JAXB tries to reference the local part of a QName that is a data element within the Node, and I would get an exception stating that the local part could not be null. My Java distribution used DOM level 2, which (from what I could gather from JavaDocs of different Node classes) explicitly states that the above-mentioned local part of the QName is *always* null. Maybe JAXB 1.0.1 had been written for a previous DOM implementation.

            If you don't run into this, or if you find a way around it, the answer would be extremely useful to me.

            thanks,
            -Kyle Duncan

            • 3. Re: Need help debugging web service deployment
              fss

              This should work!

              ...
              JAXBContext jaxbContext =JAXBContext.newInstance(...);
              Marshaller m = jaxbContext.createMarshaller();
              m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
              
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              Document doc = dbf.newDocumentBuilder().newDocument();
              
              m.marshal(_o, doc);
              
              SOAPMessage message = MessageFactory.newInstance().createMessage();
              SOAPBody body = message.getSOAPPart().getEnvelope().getBody();
              element = body.addDocument(doc);