• Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI security problem

 
chi Lin
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I follow RMI example code on one book, all files compile OK,
when I tried to run the code, I got some exception message like,
java.security.AccessControlException : access denied
if I comment out the following line, whole thing runs OK
// System.setSecurityManager( new RMISecurityManager());
could someone advise how can I fix the security problem ?
thx
 
Jack Zhou
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
depends on your programm, when you set a SecurityManager. Your programm's access to system resource will be checked against your security policy normally decided by a file $(JAVA_HOME)/jre/lib/security/java.policy.
e.g. If you want to read a file then you need proper FilePermission to be set up in the policy file. So make sure you configure your policy file so that your program's access is allowed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!