RMI Policy File Question
Hello All,
Thanks for view my thread. I have been fighting a security manager issue for a while now. My code works fine when I do not use the security manager but when I use it I get errors. I am using RMI between a XP and Fedora machine. The code is very trivial. I am just sending a string from one machine to the next. The code below is the issue:
if (System.getSecurityManager() == null)
System.setSecurityManager ( new RMISecurityManager() {
public voud checkConnect (String host, int port){}
});
Properties props = new Properties();
props.put("java.security.policy", "C//workspace//RMI2//src//policy");
Policy file:
grant{
permission.java.security.AllPermission;
};
I'm am pretty sure it is my permissions file that I do not understand. Currently I have my permissions file in the same folder/directory as my java workspace classes. On the Fedora I was also able to put a .java.policy file in my home directory.
I also read there is suppose to be a .java.policy file in the C:\Windows folder on the XP machine but I am unsure how to do this? I would appreciate any assistance regarding the correct setup up of an RMI policy file among a Fedora and XP machine. Thanks so much again!
Dan
|