RMI AccessControlException - VM parameter

s_lavie used Ask the Experts™
I'm running an RMI server application with the VM parameter:
and everything works fine.
When I'm trying to set that parameter using:
System.setProperty("java.security.policy", "file:\"C:\\RMITest\"\\rmi.policy"); // the first line in code
I get the following exception:
java.security.AccessControlException: access denied (java.io.FilePermission server.properties read)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
      at java.security.AccessController.checkPermission(AccessController.java:401)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
      at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
      at java.io.FileInputStream.<init>(FileInputStream.java:100)
      at java.io.FileInputStream.<init>(FileInputStream.java:66)
Is there a way to avoid that VM parameter?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Have you tried (URL format)


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial