Error running server and client RMI programs on different host machines
843793Aug 15 2001 — edited Nov 13 2001I am trying out an RMI example given in the RMI Tutorial at
http://web2.java.sun.com/docs/books/tutorial/rmi/compiling.html
On running both server and client programs on the same machine, I am not getting any errors. But if I try to run the client program by having the server running on some other machine, I am getting the error below.
ComputePi exception: RemoteException occured in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.jang.ClassNotFoundException: client.Pi
java.rmi.serverException: RemoteExcetion occured in server thread; nested exception
is: java.rmi.UnmarshalExceprion: error unmarshalling arguments; nested exception is:
java.jang.ClassNotFoundException: client.Pi
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.jang.ClassNotFoundException: client.Pi
java.lang.ClassNotFoundException; cient.Pi
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at engine.ComputeEngine_Stub.executeTask(Unknown Source)
at engine.ComputePi.main(ComputePi.java:16)
1. I started the server program on host 'frank1' like this
set classpath=c:\home\ann\src;c:\home\ann\public_html\classes\compute.jar
java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
-Djava.rmi.server.hostname=frank1 -Djava.security.policy=noweb.policy
engine.ComputeEngine
2. I am starting the client program on host 'kelly' as
set CLASSPATH=c:\home\jones\src;c:\home\jones\public_html\classes\compute.jar
java -Djava.rmi.server.codebase=file:/c:\home\jones\public_html\classes/
-Djava.security.policy=noweb.policy client.ComputePi frank1 20
3. Contents of non_web.policy is
grant {
permission java.net.SocketPermission "*:1024-65535", "connect,accept";
permission java.io.FilePermission "c:\\home\\ann\\public_html\\classes\\-", "read";
permission java.io.FilePermission "c:\\home\\jones\\public_html\\classes\\-", "read";
};
Could anyone help me in solving this? Could anyone try out the example at http://web2.java.sun.com/docs/books/tutorial/rmi/compiling.html and see if you too are getting the same error?