RMI with Mixed JVM versions

J

Jeff

Is there anything in the specs that explicitly prohibits running
an RMI server process under JDK 1.4.x and running the
client under JDK 1.1.8? I'm trying to do a migration
without forcing everything to go to 1.4.x simultaneously.
However I'm having trouble with security issues. Yes, I know
I should post details, but I'm at home now with some time to
kill and I don't have the project in front of me. Basically, the
1.1.8 JVM client complains about not having a security manager
installed and thus the stub class loader is diabled. Using
-Djava.security.manager with the 1.1.8 client just doesn't
work. Any pointers to web resources would be greatly
appreciated.

Thanks,
 
E

EJP

Try the online 1.1.8 docs at Sun. java.security.manager is a 1.2-ism,
won't work on 1.1. You have to do System.setSecurityManager(new
RMISecurityManager()) in the client. There's no other reason why it
shouldn't work, Sun test this sort of thing extensively, and if it
doesn't work it's a bug.

EJP
 
J

Jeff

When I call System.setSecurityMananger(new RMISecurityManager())
in the 1.1.8 client code, it just throws a security exception.
I can't find anything in the docs that explains how to set the
security policy in 1.1

*** Security Exception: checkConnect:To 192.168.1.36 ***
java.rmi.RMISecurityException: security.checkConnect: To 192.168.1.36
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at java.lang.SecurityException.<init>(Compiled Code)
at java.rmi.RMISecurityException.<init>(Compiled Code)
at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
at sun.rmi.transport.tcp.TCPChannel.checkConnect(Compiled Code)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
at sun.rmi.server.UnicastRef.newCall(Compiled Code)
at EchoServer_Stub.echo(Compiled Code)
at EchoClient.main(Compiled Code)
java.rmi.RMISecurityException: security.checkConnect: To 192.168.1.36
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at java.lang.SecurityException.<init>(Compiled Code)
at java.rmi.RMISecurityException.<init>(Compiled Code)
at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
at java.rmi.RMISecurityManager.checkConnect(Compiled Code)
at sun.rmi.transport.tcp.TCPChannel.checkConnect(Compiled Code)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Compiled Code)
at sun.rmi.server.UnicastRef.newCall(Compiled Code)
at EchoServer_Stub.echo(Compiled Code)
at EchoClient.main(Compiled Code)
 
E

EJP

I believe you have to write your own subclass of RMISecurityManager with
appropriate overrides esp. for checkConnect() and friends.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top