IllegalArgumentException from RMI

D

Dave Rudolf

Hi all.

I have an RMI client/server system going, and the client is able to call
most of the methods of the server object without any problem. For some
reason, there is one method that, when invoked in the stub, throws an
IllegalArgumentException. The call never makes it to the server object, so I
assume that the exception is being thrown by the stub or perhaps the
rmiregistry.

I would assume that such an exception is thrown because there is something
screwy between the stub and the skel class. So I delete my class files and
do a fresh build, reboot my machine, slap the monitor a few times, then
restart the registry. I still get the error. The exact exception is:

java.lang.IllegalArgumentException: argument type mismatch
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
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7
01)
at java.lang.Thread.run(Thread.java:536)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:247)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at ass3.RmiMetaServer_Stub.transferServer(Unknown Source)
at ass3.RmiMetaServer.moveServer(RmiMetaServer.java:145)
... 11 more

Any idea as to why this exception is being thrown?

Dave
 
E

EJP

The exception is being thrown by the RMI runtime in the server, trying
to invoke the method in the server object. It indicates a mismatch
between the stub (and skeleton if any) and the actual server object. Did
you change a calling sequence at some time? Make sure there aren't any
old stubs lying around e.g. where RMI Registry can see them.

EJP
 
D

Dave Rudolf

Yep, I nuked the class files (including stub and skel), and rebuilt from
scratch. It still gives the exception. I did make some changes to the
interface, and the server object, but that was before doing a rebuild. So
the stub and skel should be up to date.
 
E

EJP

If you're sure there are no dead stubs or skeletons or remote interfaces
lying around it's a bug - report it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top