rmi registry basic question

I'm trying my first rmi application using eclipse and genady's rmi tools. The application will use a client to query a server database. The query will be done on the server and the result returned to the client.

Everything works just fine so long as I'm on a single machine. The problem is that I can't get it to respond if I move the client to another machine.

Just to make things concrete, I'm developing the server on //home-ilan and I want //home-yona to run the client. On home-ilan I have f:\eclipse\workspace shared out as //home-ilan/workspace, and I indeed see this URL on home-yona.

If I run Genady's RMI Spy, I see when my local machine running the client turns to itself and queries the database. If I try to run the client from home-yona, RMI Spy shows no activity.

My suspicion is that home-yona isn't looking at home-ilan to pick up the stub. On home-yona I have the client, rmi_security.policy and a bat file to run the program. On home-ilan I have rmiregistry running, the server is running and the console tells me that StudiesEngine is bound in the registry. Thus everything looks OK on the server.

My bat file on the client says:

C:\Ilan\ReadStudies>java -cp .;//home-ilan/workspace -Djava.security.policy=c:\i

lan\ReadStudies\rmi_security.policy -Djava.rmi.server.codebase=file://home-ilan/

workspace/ReadStudies/ -Djava.rmi.server.hostname=home-ilan client/StudiesClient

It gives a short error message when I run it:

QueryServer err: error unmarshalling return; nested exception is:

java.lang.ClassNotFoundException: access to class loader denied

Just for completeness my security.policy is:

grant {

permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc", "read";

permission java.util.PropertyPermission "file.encoding", "read";

permission java.net.SocketPermission "*:1024-65535", "connect,accept";

permission java.net.SocketPermission "*:80", "connect";

};

Again, my suspicion is that home-yona isn't even looking at home-ilan and thus it doesn't see the home-ilan rmiregistry. Can anyone tell me if this is true or false? Maybe I need an http server? If so, is there a trivial one which I can use to test?

Thanks,

Ilan

[2320 byte] By [Ilana] at [2007-11-26 12:24:10]
# 1
Genady was a great help in solving this problem. It needed AllPermissions on the client and finally it is up and flying.
Ilana at 2007-7-7 15:25:05 > top of Java-index,Core,Core APIs...
# 2
You should use the java.security.debug option to find out what concrete permissions were required and add those rather than just AllPermission. Otherwise you may as well not run a security manager at all.
ejpa at 2007-7-7 15:25:05 > top of Java-index,Core,Core APIs...
# 3
We've been discussing it off-site. Security manager is needed for remote class loading and IMHO it's better to start with a simple policy, solve the other problems and if necessary restrict it to the right permissions.Genady
genadya at 2007-7-7 15:25:05 > top of Java-index,Core,Core APIs...