My directory structure:
server:
C:\rmisample\server\
..\public\classes\engine\ComputeEngine_Stub.class
..\ComputeEngine_Skel.class
..\src\compute.jar
..\engine\ComputeEngine.class
client:
C:\rmisample\client\
..\public\classes\client\Pi.class
..\src\compute.jar
..\client\ComputePi.class
..\Pi.class
firstly, I start rmiregistry:
1) set classpath=
--I want to unset classpath, is right?
2) start rmiregistry
2. start server of engine.ComputeEngine int directory C:\rmisample\server\src>
java -classpath compute.jar;.
-Djava.rmi.server.codebase=file:/c:\rmisample\server\public\classes/
-Djava.rmi.server.hostname=localhost
-Djava.security.policy=java.policy
engine.ComputeEngine
3. run client program client.ComputePi in directory C:\rmisample\client\src>
java -classpath compute.jar;.
-Djava.rmi.server.codebase=file:/c:\rmisample\client\public\classes/
-Djava.security.policy=java.policy
client.ComputePi 10.194.72.80 20
it will work if they are run on the same PC.
but if I move the client part to the other one,
i cannot run the client and get the exception like this:
ComputePi exception: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at client.ComputePi.main(ComputePi.java:14)
if I copy the stub of server to the classpath of client,
it will work with two PCs.
this exception looks like from the setting of classpath of rmiregistry
but WHY? is it right i execute "set classpath=" to unset classpath?
(I'm using WindowsXP)
[ February 27, 2003: Message edited by: keisin syu ]