I am quite new to RMI and have a question about security.
In my RMIServer class i set the following:
System.setSecurityManager(new RMISecurityManager());
When trying to run the server I got the following exception:
java.security.AccessControlException: access denied
(java.net.SocketPermission 127.0.0.1:10003 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
at java.security.AccessController.checkPermission(AccessController.java:401)
...
I tried to run it with a policy file like this:
grant {
permission java.net.SocketPermission "localhost:10003",
"connect,resolve";
};
But i still got the same exception. I then tried without setting the
SecurityManager and without the policy file and everything worked
fine!!
Can anyone tell me why?
(Both the server and the client are run locally)
Regards,
Kjartan
Are you doing this on windows? Once i spent an afternoon fiddling with
the policy file before i realised that there were two of that kind - one
in the JRE, one in the JDK directory :-(
Greetings
Andreas
I didn't think of that possibility. When I changed the policy file in the
JRE directory everything worked fine!
Regards,
Kjartan
Andreas Wollschlaeger <postm...@1.0.0.127.in-addr.arpa> wrote in message news:<3D188B0E...@1.0.0.127.in-addr.arpa>...