Solved

RMI AccessControlException - VM parameter

Posted on 2003-10-27
1
317 Views
Last Modified: 2006-11-17
I'm running an RMI server application with the VM parameter:
-Djava.security.policy=file:"C:\RMITest"\rmi.policy
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)
      ...
Why?
Is there a way to avoid that VM parameter?
0
Comment
Question by:s_lavie
1 Comment
 
LVL 1

Accepted Solution

by:
amswain earned 125 total points
ID: 9627072
Have you tried (URL format)

"file:///C:/RMITest/rmi.policy"
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now