2 Replies Latest reply on Oct 24, 2007 3:29 AM by Alessio Soldano

    org.jboss.ws.WSException: Cannot find java method

    Aldo Lezza Newbie

      Hi,
      I used wscompile to generate a webservice starting from a correct WSDL.
      Deploy went OK, but when I run the client class to test the service I got the following exception in server-side log.

      
      org.jboss.ws.WSException: Cannot find java method: controlloAccessoOperation
       at org.jboss.ws.metadata.OperationMetaData.getJavaMethod(OperationMetaData.java:213)
       at org.jboss.ws.binding.EndpointInvocation.getJavaMethod(EndpointInvocation.java:82)
       at org.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvokerJSE.java:87)
       at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
       at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
       at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
       at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
       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:96)
       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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       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:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       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)
      
      
      
      



      I generated the files with the following files:

      wscompile input

      
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
       <wsdl location="src/main/resources/web/wsdl/ControlloAccesso.wsdl"
       packageName="org.jbpm.bpel.login">
       <!--<namespaceMappingRegistry>
       <namespaceMapping namespace="http://j2ee.netbeans.org/xsd/ControlloAccesso"
       packageName="org.jbpm.bpel.types" />
       </namespaceMappingRegistry>-->
       </wsdl>
      </configuration>
      
      


      WSDL file
      
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="ControlloAccesso" targetNamespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://j2ee.netbeans.org/wsdl/ControlloAccesso" xmlns:ns="http://xml.netbeans.org/schema/LoginTypes" xmlns:plink="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
       <types>
       <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso">
       <xsd:import namespace="http://xml.netbeans.org/schema/LoginTypes" schemaLocation="types.xsd"/>
       </xsd:schema>
       </types>
       <message name="ControlloAccessoOperationRequest">
       <part name="part1" type="ns:Credenziali"/>
       </message>
       <message name="ControlloAccessoOperationReply">
       <part name="part1" type="ns:Identificato"/>
       </message>
       <portType name="ControlloAccessoPortType">
       <operation name="ControlloAccessoOperation">
       <input name="input1" message="tns:ControlloAccessoOperationRequest"/>
       <output name="output1" message="tns:ControlloAccessoOperationReply"/>
       </operation>
       </portType>
       <binding name="ControlloAccessoBinding" type="tns:ControlloAccessoPortType">
       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="ControlloAccessoOperation">
       <soap:operation/>
       <input name="input1">
       <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"/>
       </input>
       <output name="output1">
       <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"/>
       </output>
       </operation>
       </binding>
       <service name="ControlloAccessoService">
       <port name="ControlloAccessoPort" binding="tns:ControlloAccessoBinding">
       <soap:address location="http://localhost:18181/ControlloAccessoService/ControlloAccessoPort"/>
       </port>
       </service>
       <plink:partnerLinkType name="ControlloAccessoPartner">
       <!-- partnerLinkType are automatically generated when a new portType is added. partnerLinkType are used by BPEL processes.
      In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
      A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
       <plink:role name="ControlloAccessoPortTypeRole" portType="tns:ControlloAccessoPortType"/>
       </plink:partnerLinkType>
      </definitions>
      
      



      Imported schema
      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       targetNamespace="http://xml.netbeans.org/schema/LoginTypes"
       xmlns:tns="http://xml.netbeans.org/schema/LoginTypes">
       <xsd:complexType name="Credenziali">
       <xsd:sequence>
       <xsd:element name="nome" type="xsd:string"></xsd:element>
       <xsd:element name="password" type="xsd:string"></xsd:element>
       </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="Identificato">
       <xsd:sequence>
       <xsd:element name="Esito" type="xsd:string"></xsd:element>
       </xsd:sequence>
       </xsd:complexType>
      </xsd:schema>
      
      


      web.xml file



      
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" 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">
      
       <!-- Production Scheduling Process -->
       <servlet>
       <servlet-name>controlloServlet</servlet-name>
       <servlet-class>
       org.jbpm.bpel.login.Impl
       </servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>controlloServlet</servlet-name>
       <url-pattern>/controllo</url-pattern>
       </servlet-mapping>
      
      </web-app>
      
      


      And finally the webservices.xml file

      
      <?xml version="1.0" encoding="UTF-8"?>
      <webservices version="1.1" 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/j2ee_web_services_1_1.xsd">
      
       <webservice-description>
      
       <webservice-description-name>
       Controllo Autenticazione
       </webservice-description-name>
       <wsdl-file>WEB-INF/wsdl/ControlloAccesso.wsdl</wsdl-file>
       <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
      
       <port-component>
      
       <port-component-name>ControlloAccessoPort</port-component-name>
       <wsdl-port xmlns:portNS="http://j2ee.netbeans.org/wsdl/ControlloAccesso">portNS:ControlloAccessoPort</wsdl-port>
       <service-endpoint-interface>
       org.jbpm.bpel.login.ControlloAccessoPortType
       </service-endpoint-interface>
       <service-impl-bean>
       <servlet-link>controlloServlet</servlet-link>
       </service-impl-bean>
      
       </port-component>
      
       </webservice-description>
      
      </webservices>
      
      


      I hope my information are enought to get a solution. Bye

        • 1. Re: org.jboss.ws.WSException: Cannot find java method
          Aldo Lezza Newbie

          I just modified my WSDL like this

          
          <?xml version="1.0" encoding="UTF-8"?>
          <definitions name="ControlloAccesso" targetNamespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"
           xmlns="http://schemas.xmlsoap.org/wsdl/"
           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://j2ee.netbeans.org/wsdl/ControlloAccesso" xmlns:ns="http://xml.netbeans.org/schema/LoginTypes">
           <types>
           <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso">
           <xsd:import namespace="http://xml.netbeans.org/schema/LoginTypes" schemaLocation="types.xsd"/>
           </xsd:schema>
           </types>
           <message name="ControlloAccessoOperationRequest">
           <part name="cred" type="ns:Credenziali"/>
           </message>
           <message name="ControlloAccessoOperationReply">
           <part name="iden" type="ns:Identificato"/>
           </message>
           <portType name="ControlloAccessoPortType">
           <operation name="controlloAccessoOperation">
           <input message="tns:ControlloAccessoOperationRequest"/>
           <output message="tns:ControlloAccessoOperationReply"/>
           </operation>
           </portType>
           <binding name="ControlloAccessoBinding" type="tns:ControlloAccessoPortType">
           <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
           <operation name="controlloAccessoOperation">
           <soap:operation/>
           <input>
           <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"/>
           </input>
           <output>
           <soap:body use="literal" namespace="http://j2ee.netbeans.org/wsdl/ControlloAccesso"/>
           </output>
           </operation>
           </binding>
           <service name="ControlloAccessoService">
           <port name="ControlloAccessoPort" binding="tns:ControlloAccessoBinding">
           <soap:address location="http://localhost:8080/ControlloAccesso/controllo"/>
           </port>
           </service>
          
          </definitions>
          
          


          ant regenerating the service went OK.
          I dunno if the problem was in the attribute name of binding operation or message part but now it works!

          • 2. Re: org.jboss.ws.WSException: Cannot find java method
            Alessio Soldano Master

            Yes, that could be the problem.Generally speaking, In future I would also suggest you to evaluate switching to JAX-WS.
            Bye