Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

rmi security exception (newbie)

  Asked By: Fabiana    Date: Apr 05    Category: Java    Views: 1886

I am just beginning with RMI, and I already have run into
problems. I have tried to start the server and the client.
When I do, I get a security exception. I have followed the
instructions in the tutorial, but to no avail ;(

Here is what I have entered, and found:

C:\rmi>java -Djava.security.policy=java.policy PowerServiceServer
Exception in thread "main" java.security.AccessControlException:
access denied (java.net.SocketPermission



1 Answer Found

Answer #1    Answered By: Eloise Lawrence     Answered On: Apr 05

You can give grant all security  in the policy  file OR a sample policy file as below

grant {
permission java.net.SocketPermission "*:1024-65535",
permission java.net.SocketPermission "*:80", "connect";
Note: Above, pasted from java.sun.com/docs/books/tutorial/rmi/running.html
Remember, if client  is running on a separate machine, You need a policy for both machines. rmi  claims to download stub files and policy file remotely but it doesn't do this in reality, this leads to such confusions.

Didn't find what you were looking for? Find more on rmi security exception (newbie) Or get search suggestion and latest updates.