1 Reply Latest reply on Mar 13, 2003 2:05 AM by shogun1234

    ClassCastException

    shogun1234

      i'd been successfully exposure an example of web service via ejb, in which the base env is jboss3.0.4, axis beta1, j2sdk1.4.1_01. however, i encounter a problem when running web services client that would not occurred when run through ejb test client. the exception is as mesage A).
      the way i call that services coded in client is simplely via ustlizing code such as

      String endpoint = "http://localhost:8080/axis/services/ServiceName";
      Service service = new Service();
      Call call = (Call)service.createCall();
      call.setTargetEndpointAddress(new URL(endpoint));
      call.setOperationName(new QName("MethodName"));
      call.invoke( new Object[] { PRARM_NAME });

      the return type is Vector, for at first i guess that may result from its return type, but i found out vector is seemly supported as stated in http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC3.html#79859.
      (in fact, i can see the output on the console in the server side when running ws client, but it issues error in client side console.)

      i have no idea the reason why it's so. hope someone can give me some idea about that.
      i appreciate any suggestions,
      thank you very much.

      ==========
      A.)
      java.lang.ClassCastException
      at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown Source)
      at org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknow
      n Source)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
      at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
      at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
      at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)

      at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
      at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown Sou
      rce)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
      at org.apache.axis.client.Call.invoke(Unknown Source)
      at org.apache.axis.client.Call.invoke(Unknown Source)
      at org.apache.axis.client.Call.invoke(Unknown Source)
      at org.apache.axis.client.Call.invoke(Unknown Source)

        • 1. Re: ClassCastException
          shogun1234

          after few rework with the code, i found out it seems that the problem resulted from the communication between the server side and client side when sending object such as Vector. for i check the mailing list on axis, stating that with method "org.apache.axis.utils.JavaUtils.convert(response, Vector.class);" may resolve my problem. however, it now issues exception as A.)
          is there possiblilty may cause such kind of exception?
          i appreciate any suggestions,
          thank you very much.
          ============
          java.rmi.ServerException: RuntimeException; nested exception is:
          java.lang.reflect.UndeclaredThrowableException
          ......
          ============