Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RMI headaches




On Jul 10, 2005, at 8:37 PM, Joseph Dane wrote:

Todd O'Bryan <email@hidden> writes:


The weird thing is that ServerImplementation_Stub.class is right
there inside the same folder as StartServer.class and
ServerImplementation.class, so I can't understand why the ClassLoader
can find them and not it. I have this problem both when I run from
inside Eclipse using the RMI Plugin, but also when I run from the
command line.

Any ideas?


are you using a pre-1.5? things have changed in 1.5 in ways that I'm not completely familiar with (you don't need to run a separate stub compiler, for one thing), but I might still be able to help.

there are two JVMs involved here: your server and the RMI registry,
into which you're trying to bind a reference to your server.  it's the
registry that's complaining about not being able to load the class.

probably when you started the registry you didn't set its CLASSPATH to
something containing the stubs.  which is normally exactly what you'd
want to do.

much more about this can be found here:

http://java.sun.com/j2se/1.5.0/docs/guide/rmi/codebase.html

one of the features of RMI I didn't mention previously was "code
downloading".  RMI can arrange for java classes to be downloaded
from somewhere to the client prior to being executed.  typically you'd
do this with the stubs.  that is, rather than packaging the stub
classes with the client, you'd allow the client (the RMI runtime on
the client) to download the classes at runtime.

I thought that codebase was only used for downloading classes, and knew I didn't want to do that. But the RMI Plugin for Eclipse doesn't, by default, pass the project classpath to the RMI Registry when it starts it.


Fortunately, there's a little button to build the codebase based on the project classpath, but you have to know that you need to set it. :-)

Thanks! The program now works.

Todd

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >RMI, old Sockets, new Channels? Help!!! (From: "Todd O'Bryan" <email@hidden>)
 >Re: RMI, old Sockets, new Channels? Help!!! (From: Joseph Dane <email@hidden>)
 >RMI headaches (From: "Todd O'Bryan" <email@hidden>)
 >Re: RMI headaches (From: Joseph Dane <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.