The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

rmiregistry needs to find the stub

Posted by jdv on September 13, 2001 at 9:18 PM

> Hello,

> I'm trying to get a simple RMI app. up and running (from the Sun RMI
> tutorial,
> http://developer.java.sun.com/developer/onlineTraining/rmi/RMI.html ).
> Anyways, I'm running both the server and client in the same directory.
> I created the interface, the service, the server, and the client all
> according to the code given in the tutorial. I generated the stub and
> skel classes. rmiregistery is running, but when I try to start the
> server, this is what I see.....

> java.rmi.ServerException: RemoteException occured in server thread;
> nested exception is:
> java.rmi.UnmarshalException: error unmarshalling arguments; nested
> exception is:
> java.lang.ClassNotFoundException: CalculatorImpl_Stub

> The CalculaorImpl_Stub class is sitting right there, but jdk says it's
> not there. I'm sure it's something really simple I'm missing. Thank
> you for any help you might be able to provide.

This one caught me, as well. It looks like that when you run this test _locally_, rmiregistry needs to be able to find the stub. I had to run it in the same directory as CalculatorImpl_Stub to get things to work. I imagine you could put the stub in the rmiregistry's classpath, as well.

My understanding is that if you are running the example on different boxes/JVMs, the stub should not be on the classpath of the rmiregistry process.

This sounds wrong, and I haven't tested. Still an RMI beginner.

jdv



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us