1 Reply Latest reply on May 22, 2006 1:22 AM by sonalraj

    ClassCastException: org.jboss.axis.Message

    sonalraj

      Hi All,
      I've written two clients (DII and static stub client) for my webservice.The DII client works fine but not able to write the static stub client.Here is the my static stub client code :

      Stub stub = (Stub) (new CommerceItemService_Impl().getProductCollectionServicePort());
      stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/commerceItems/ProductCollection");
      System.out.println(stub._getProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY));
      ProductCollectionService service =(ProductCollectionService) stub;
      service.testMethod();


      Want to invoke the web-service method "testMethod()" ,but gives following error:

      Exception in thread "main" java.lang.ClassCastException: org.jboss.axis.Message
      at com.sun.xml.rpc.client.StubBase._postSendingHook(StubBase.java:231)
      at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:324)
      at com.clientproject.commerceItems.client.stubs.ProductCollectionService_Stub.testMethod(ProductCollectionService_Stub.java:69)
      at com.clientproject.commerceItems.client.stubs.StaticStubClient.main(StaticStubClient.java:20)

      --
      Sonal

        • 1. Re: ClassCastException: org.jboss.axis.Message
          sonalraj

          Hi All,
          The stubs are generated using wscompile tool.
          Sun StubBase class is casting the response message to com.sun.xml.messaging.saaj.soap.MessageImpl and Since JBoss uses an axis message factory for the response message.so there is the "Class Cast Exception".

          But still not able to find the solution.

          --
          Sonal