2 Replies Latest reply on May 18, 2009 5:35 AM by Alessio Soldano

    dynamic proxy client fails

    howard goldberg Newbie

      AS 5.01
      Jdk 1.60_13
      eclipse 3.4 with jboss tools 3.01
      centos 5.2

      I can't get a dynamic proxy client to work--fails with the infamous runtime modeler error. See service and client source below. Deploys without problems, 1 warning about deployment descriptor for context. In log file, proxy classes are generated. If I create a client with static stubs using wsconsume, client succeeds.

      Can someone verify for me that service and client work. This was a clean install, and code fails on a separate machine and under 5.1. Haven't seen any similar issues via Google or in the user forum. Am I missing a configuration step, or is there some kind of classloader issue? This is pretty vanilla. Thanks for your help!

      Interface:

      package org.goldberg;

      import javax.ejb.Remote;
      import javax.jws.WebService;

      @WebService(targetNamespace="http://goldberg.org/hello")
      @Remote
      public interface Hello {
      String echo(String source);
      }

      Implementation:

      package org.goldberg;

      import javax.ejb.Stateless;
      import javax.jws.WebService;

      import org.goldberg.Hello;

      public
      @WebService(targetNamespace="http://goldberg.org/hello",
      endpointInterface="org.goldberg.Hello")
      @Stateless class HelloBean implements Hello {

      public String echo(String source) {
      // TODO Auto-generated method stub
      return source;
      }

      }
      Dynamic Proxy Client--fails at getPort

      package org.goldberg.test;

      import java.net.URL;

      import javax.xml.namespace.QName;
      import javax.xml.ws.Service;

      import org.goldberg.Hello;

      public class TestWS {

      /**
      * @param args
      */
      public static void main(String[] args) {
      // TODO Auto-generated method stub
      String wsdlURLString = "http://localhost:8080/HelloWS/HelloBean?wsdl";
      String serviceName = "HelloBeanService";
      String nameSpaceURI = "http://goldberg.org/hello";
      //String portName = "HelloPort";
      try {
      URL wsdlURL = new URL(wsdlURLString);
      Service HelloService = Service.create(wsdlURL, new QName(nameSpaceURI,serviceName));
      Hello hello = HelloService.getPort(Hello.class);
      System.out.println(hello.echo("I'm working!"));
      } catch (Exception e) {e.printStackTrace();}
      }

      }


      Deployment warning
      22:34:57,486 INFO [DefaultEndpointRegistry] register: jboss.ws:context=HelloWS,endpoint=HelloBean
      22:34:59,939 INFO [WSDLFilePublisher] WSDL published to: file:/usr/local/jboss/jboss-5.0.1.GA/server/default/data/wsdl/HelloWS.jar/HelloBeanService6116139100620733119.wsdl
      22:34:59,972 INFO [TomcatDeployment] deploy, ctxPath=/HelloWS
      22:35:00,034 WARN [config] Unable to process deployment descriptor for context '/HelloWS'
      22:35:01,023 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
      22:35:01,064 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
      22:35:01,075 INFO [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902232048)] Started in 49s:915ms

      Proxy Classes generated from log file
      2009-05-12 22:34:58,776 DEBUG [org.jboss.ws.core.jaxws.DynamicWrapperGenerator] (main) Generating wrapper: org.goldberg.jaxws.Echo
      2009-05-12 22:34:58,788 DEBUG [org.jboss.ws.core.jaxws.DynamicWrapperGenerator] (main) Generating wrapper: org.goldberg.jaxws.EchoResponse
      2009-05-12 22:34:58,802 DEBUG [org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder] (main) JAXBContext [types=[class org.goldberg.jaxws.Echo, class org.goldberg.jaxws.EchoResponse],tns=http://goldberg.org/hello]

      Client error: Wrapper class not found
      com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class org.goldberg.jaxws.Echo is not found. Have you run APT to generate them?
      at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:287)
      at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:596)
      at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:543)
      at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:371)
      at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
      at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:633)
      at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:328)
      at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:311)
      at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:339)
      at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:343)
      at javax.xml.ws.Service.getPort(Service.java:161)
      at org.goldberg.test.TestWS.main(TestWS.java:25)