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