GeeCON Prague 2014*
The moose likes Web Services and the fly likes java.lang.IllegalArgumentException:object is not an instance of declaring class from JAX-RPC client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "java.lang.IllegalArgumentException:object is not an instance of declaring class from JAX-RPC client" Watch "java.lang.IllegalArgumentException:object is not an instance of declaring class from JAX-RPC client" New topic
Author

java.lang.IllegalArgumentException:object is not an instance of declaring class from JAX-RPC client

ramakrishna nandikonda
Greenhorn

Joined: Jan 05, 2009
Posts: 1
Hi all,

I am getting java.lang.IllegalArgumentException: object is not an instance of declaring class exception from JAX-RPC client when calling remote method.we are using ARTIX application server and Tomcat webserver ,artix generated java class for the WSDL and invoking remote method using webservices(WSDL).so, we are writing one client program to invoke the remote method .In that client program stub is generating to call the remote method.

ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new URL(wsdlpath),new QName("targetNamespace","servicename"));
impl = (typecastingto interfaceclass)service.getPort(portName,interfaceclass file generated by artix server);

Here impl is the java reference i.e interface class.

try {
response object = impl.remotemethodname(client request object);

}

when calling remote method in this try block, i am getting the java.lang.IllegalArgumentException: object is not an instance of declaring class exception (this is happening some times only). Some times i can able to call the remothe method and i can get the response from remote server successfully.

The stackTrace for this exception is as follows:

java.lang.IllegalArgumentException: object is not an instance of declaring class
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.iona.jbus.types.SequenceTypeHandler.write(SequenceTypeHandler.java:210)
at com.iona.jbus.ntv.NativeMessageWriter.writeSequence(Native Method)
at com.iona.jbus.ntv.NativeMessageWriter.writeSequence(NativeMessageWriter.java:308)
at com.iona.jbus.messaging.MessageWriter.write(MessageWriter.java:215)
at com.iona.jbus.ntv.NativeMessageWriter.writeElement(NativeMessageWriter.java:384)
at com.iona.jbus.messaging.MessageWriter.write(MessageWriter.java:202)
at com.iona.jbus.types.SequenceTypeHandler.write(SequenceTypeHandler.java:226)
at com.iona.jbus.ntv.NativeClientOperation.invoke(Native
Method)
at com.iona.jbus.ntv.NativeClientOperation.invoke(NativeClientOperation.java:78)
at com.iona.jbus.runtime.ServiceInvokeHandler.invoke(ServiceInvokeHandler.java:634)
at $Proxy2.remotemethodname(Unknown Source)

but this problem is resolving by restarting our Tomcat server.But this is not permanent solution.Please anyone can suggest the permanent fix for this.
 
GeeCON Prague 2014
 
subject: java.lang.IllegalArgumentException:object is not an instance of declaring class from JAX-RPC client