CLASSPATH, rmiregistry, unmarshalling exceptions and more !!
843793Nov 18 2003 — edited Nov 19 2003Hi all,
I am close to getting a very simple RMI example to work.
Basically, this is what I have:
On one PC, I have both the client and the server. One command prompt downloads the stub from the apache webserver directory. To do this, I use two command prompts/windows: in one, I say "set CLASSPATH="
and then "rmiregistry". Then in the next command prompt, I do a
"java -Djava.rmi.codebase=http://localhost/ Djava.security.policy=policy HelloImpl" (NB: policy is a simply, allow-access-to-all policy).
In another window, I cd into my client directory and do "java -Djava.security.policy=policy -Djava.security.manager HelloClient"
- this DOES work! Hurrah!
-------------------------------------------------------------
But it I try and do the same thing, so that the server side part of
this RMI link is on a remote Sun machine, so that I am calling it from
a PC, I get "StubNotFoundException". Note that the Sun machine has no CLASSPATHs set, and I get the above exception if I launch rmiregistry and "java -D.....etc." from different directories. If I start them off from the same directory (containing the *.class, stubs/skels and policy files), I get the message that "my object is bound in the registry"...but then I can't download the stub from the server!
The problem seems to be the definition of Classpaths as, apart from the remote nature of this second try, everything seems to be fine.