8 Replies Latest reply on Sep 18, 2007 1:37 PM by fabiopmiranda

    NoSuchMethodError in remote client WS  call

    at7000ft

      I am getting the following error when trying to get a Service instance in a remote client to an example Web service I have deployed to JBoss 4.0.4GA:

      java.lang.NoSuchMethodError: com.ibm.wsdl.xml.WSDLReaderImpl.setEntityResolver(Lorg/xml/sax/EntityResolver;)V

      Here is my client code:
      ------------------------------------------------------------------------------
      String urlstr = "http://bldl99m4596:8090/TestJBossWS?wsdl";
      System.out.println("Contacting webservice at " + urlstr);
      URL url = new URL(urlstr);
      QName qname = new QName("http://org.jboss.ws/samples/jsr181pojo/",
      "TestService");

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(url, qname);

      ------------------------------------------------------------------------------

      And the stack:

      Exception in thread "main" java.lang.NoSuchMethodError: com.ibm.wsdl.xml.WSDLReaderImpl.setEntityResolver(Lorg/xml/sax/EntityResolver;)V
      at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:142)
      at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:273)
      at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:106)
      at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:78)
      at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
      at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
      at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
      at testws.TestClient.getEndPoint(TestClient.java:54)
      at testws.TestClient.main(TestClient.java:37)

      I assume I have the wrong version of some jar, any help would be appreciated.

      Rick Holland

        • 1. Re: NoSuchMethodError in remote client WS  call
          thomas.diesler

          Yes, you have the wrong wsdl4j.jar on your client classpath. Use the one from the jboss client dir

          • 2. Re: NoSuchMethodError in remote client WS  call
            fabiopmiranda

            I'm getting the same error... I used the wsdl4j.jar in the client dir but still not working. I'm using JDK 5 and I think this is a problem with a wrong of some jar...

            Exception in thread "main" java.lang.NoSuchMethodError: com.ibm.wsdl.xml.WSDLReaderImpl.setEntityResolver(Lorg/xml/sax/EntityResolver;)V
            at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:142)
            at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:273)
            at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:110)
            at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
            at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)


            any help would be appreciated.

            Fabio Miranda

            • 3. Re: NoSuchMethodError in remote client WS  call
              richard_opalka

              OK, ensure the followings:

              * wsdl4j.jar from jboss client dir must be the first one on the classpath
              * if this will not help, ensure IBM WSDL reader/writer implementation is not part of Java you're using. If it is apply the Java Endorsed Mechanism

              Cheers,
              Richard

              • 4. Re: NoSuchMethodError in remote client WS  call
                fabiopmiranda

                Thanks Richard ... it seems that worked ... now I got a new one Excetion:

                Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {...}


                • 5. Re: NoSuchMethodError in remote client WS  call
                  fabiopmiranda

                  I've fixed that problem ... now I have this:

                  javax.xml.rpc.ServiceException: SEI does not implement java.rmi.Remote:

                  I have an EJB with @Remote annotation.

                  any help would be appreciated.

                  Fabio Miranda

                  • 6. Re: NoSuchMethodError in remote client WS  call

                    I guess you're using JAX-RPC, am I right? I think you need to either provide a service endpoint interface implementing java.rmi.Remote or switch to JAX-WS (you're using ejb3...)

                    Alessio Soldano

                    • 7. Re: NoSuchMethodError in remote client WS  call
                      fabiopmiranda

                      Yes ... I'm using EJB 3 with JAX-RPC. I dont know what to do, do you have an example of a JAX-RPC client?

                      To switch to JAX-WS, what do I have to do in the EJB? Just take out the @SOAPBinding?

                      Follow my EJB class:

                      @Stateless
                      @WebService(name="FabioSession")
                      @SOAPBinding(style= SOAPBinding.Style.RPC)
                      public class FabioSessionBean implements FabioSession, FabioSessionWS {

                      @WebMethod
                      public String hello() {
                      return "Hello";
                      }

                      }


                      and the client:


                      ServiceFactory factory = erviceFactory.newInstance();
                      Service remote = factory.createService(url, qname);

                      FabioSession fabio = (FabioSession) remote.getPort(FabioSession.class);
                      System.out.println("Accessed local proxy: " + fabio);

                      System.out.println("Receiving: " + fabio.hello());

                      • 8. Re: NoSuchMethodError in remote client WS  call
                        fabiopmiranda

                        I've solved that problem ... I've just extends java.rmi.Remote and add this
                        @WebService(endpointInterface="com.fabio.teste.ejb.FabioSessionWS")
                        in the EJB impl class.

                        Thanks