Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Distributed Java and the fly likes Error RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Error RMI" Watch "Error RMI" New topic

Error RMI

Paolo Scire' Scappuzzo

Joined: Jan 29, 2012
Posts: 4
HI, this is my problem: i create myJava.policy that contains:

grant { permission "", "";};
grant { permission "*:1099-", "listen, accept, connect, resolve"; };
grant { permission java.util.PropertyPermission "*", "read, write"; };
grant { permission "*", "read, write"; };

i still do:


but it give me this error :
Exception in thread "main" access denied ("" "\\bin" "read")

why? In myJava.policy there's: grant { permission "*", "read, write"; };, someone can help me? Thanks.
Paolo Scire' Scappuzzo

Joined: Jan 29, 2012
Posts: 4
Solved, but i have another question for you. When i write:

System.getProperties().setProperty("", mypolicy);
System.setSecurityManager(new SecurityManager());

these 2 statements must be written as above or i have to reverse their? Because setProperty checks if a security manager exists. I don't understand what happen if it not exist. In my execution non change nothing, but at the start there's already a default security manager. I wait your answer, bye.

I agree. Here's the link:
subject: Error RMI
It's not a secret anymore!