• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

java.security.AccessControlException in Eclipse

I am using Eclipse IDE for an RMI application in Win2000. I have included in the CLASSPATH of the project the server_rmi.jar file, and also in the VM arguments the following line:

-Djava.rmi.server.codebase=file://X:/jars/server_rmi.jar

I get the following exception and have no idea how to get read of it. The access rights for the files are OK.

======= Exception message starts here ================

Starting MO Server failed. Details: java.security.AccessControlException: access denied (java.io.FilePermission \\X\jars\server_rmi.jar read)

========== End =======================================


============= policy file ==========================
grant {
     // Allow everything for now
     permission java.security.AllPermission;
};
=================== end ============================
0
dflorin
Asked:
dflorin
  • 2
  • 2
1 Solution
 
msterjevCommented:
Your codebase is wrong:

use:

-Djava.rmi.server.codebase=file:///X:/jars/server_rmi.jar

or

-Djava.rmi.server.codebase=file:/X:/jars/server_rmi.jar
0
 
dflorinAuthor Commented:
I found the the problem.

rmiregistry when started, had to have the CLASSPATH containing X:/jars.

Thanks anyway.
0
 
msterjevCommented:
NO, YOU ARE WRONG!!!!
When the RMI has the jar into the classpath,then everyone need to have the jar into its classpath. This is not the concept of RMI. Try the RMI with that configuration running on two different computers, or in our case of file codebase run client that doesn't have the jar file into it's classpath.
You are question was what is wrong with the code (the exception thrown). I've answered the problem : it is how you have written the java.rmiserver.codebase (you have written invalid codebase).

Try with the suggested codebase, and rmiregistry started with classpath unset (all books says that the rmiregistry should be started with unset classpath, i.e. in a Windows console firt type: set classpath=     and then start rmiregistry)
0
 
dflorinAuthor Commented:
Hi,

You were 100% correct. It works now fine. Thanks a lot!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now