*
The moose likes Web Services and the fly likes ClassCastException when using call.invoke() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "ClassCastException when using call.invoke()" Watch "ClassCastException when using call.invoke()" New topic
Author

ClassCastException when using call.invoke()

Anoop Nair
Ranch Hand

Joined: Oct 29, 2008
Posts: 70
Hi All...


I get a ClassCastException when executing the following line of code for invoking a web-service...


Object[] objArr = {"World"};
String message = (String) call.invoke(objArr);


The web service that is being invoked takes in a String and also returns a String...


Below is the stackTrace:

java.lang.ClassCastException
at org.openuri.www.SayHelloCodec.isPropertySet(SayHelloCodec.java:61)
at weblogic.xml.schema.binding.BeanCodecBase.writeElementContents(BeanCodecBase.java:411)
at weblogic.xml.schema.binding.BeanCodecBase.writeContents(BeanCodecBase.java:356)
at weblogic.xml.schema.binding.CodecBase.writeTypeAndContents(CodecBase.java:427)
at weblogic.xml.schema.binding.CodecBase.serializeLiteral(CodecBase.java:336)
at weblogic.xml.schema.binding.CodecBase.serialize_internal(CodecBase.java:250)
at weblogic.xml.schema.binding.CodecBase.serialize(CodecBase.java:193)
at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:188)
at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:174)
at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:328)
at weblogic.webservice.core.DefaultPart.toXML(DefaultPart.java:297)
at weblogic.webservice.core.DefaultMessage.toXML(DefaultMessage.java:645)
at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:206)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:143)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:471)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:566)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:419)
at ClientController.callService(ClientController.jpf:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:1512)
at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:1447)
at com.bea.wlw.netui.pageflow.FlowController.internalExecute(FlowController.java:778)
at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:211)
at com.bea.wlw.netui.pageflow.FlowController.execute(FlowController.java:608)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:1504)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:674)
at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6985)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)


Thanks in advance...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastException when using call.invoke()