I got a headache of that sample too..
You have to set a policy file and put it in your homedirectory, it
is described on several tutorials.
It's pretty sick that that is needed, but user-friendly-ness (while still
being secure) is for some companies or organisations hard to grasp.
--
Gerbrand van Dieijen
WWW: http://twisted.warande.net
ICQ: 19345450
Your client doesn't have access to the stub classes and so the
object being received can't be unmarshalled and instantiated.
Go back to the tutorial and find out what jars are needed on
the client side. You'll then either have to add them to your
CLASSPATH or add them to the $JAVA_HOME/jre/lib/ext directory.
C:\MyProjects\RMIDemo > start rmiregistry
I already had a batch file, and also the java.policy file:
I created a batch file with this:
set CLASSPATH=C:\MyProjects\RMIDemo
java -Djava.rmi.server.codebase=file:C:\MyProjects\RMIDemo
-Djava.rmi.server.hostname=localhost
-Djava.security.policy=java.policy engine.ComputeEngine
Now the damn thing works and I don't know what I did to get it working
except read this post.
I've gone from not being able to get it working, to not being able to
stop it from working. :-/ Maybe the classpath, though I didn't
change it...Mmm.
You must have your ComputeEngine_* files at the location specified by
the
Djava.rmi.server.codebase
In my case, I was able to specify an http address to get the files,
such as
-Djava.rmi.server.codebase=http://.../classes/ (include trailing
slash!)
Without seeing the exact java command you're running, I can only guess
at the problem. But what's suppose to happen is that when you run
your client, the RMI system is suppose to send the ComputeEngine_*
files to your client from the location specified by the above
"codebase" location.
You shouldn't need to access these stub files from the classpath. The
whole point of the demo is that RMI will transfer the defintions
across the network to your client. All you need on the client side is
access to the compute.jar file and the client .class files. All the
server and stubs are elsewhere.