Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMISecurityManager cause java.security.AccessControlException: access denied

0 views
Skip to first unread message

Kjartan Aanestad

unread,
Jun 25, 2002, 4:51:43 AM6/25/02
to
Hi,

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

Andreas Wollschlaeger

unread,
Jun 25, 2002, 11:23:58 AM6/25/02
to

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


Kjartan Aanestad

unread,
Jun 26, 2002, 3:00:04 AM6/26/02
to
Thanks a lot!

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>...

0 new messages