I am trying to run the example of the RMI application given in the Oracle website http://docs.oracle.com/javase/tutorial/rmi/running.html. However, trying both Eclipse and in the command line, I can't run the server nor the client. In fact, when running in Eclipse I get this error:
ComputeEngine exception:
java.security.AccessControlException: access denied ("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
I also have changed the VM Argument like this:
For the ComputeEngine (server):
-Djava.security.manager -Djava.rmi.server.codebase=file:/Users/name/Documents/workspace/PiComputationRM/src/compute/compute.jar -Djava.security.policy=/Users/name/Documents/workspace/PiComputationRM/server.policy
For the ComputePi (client):
-Djava.security.policy=/Users/name/Documents/workspace/PiComputationRM/client.policy
The content of my client and server policy is:
grant {
permission java.security.AllPermission;
};
Also when I try to run the server in terminal with:
java -Djava.security.policy="server.policy" src/engine/ComputeEngine.java
I got this error:
Error: Could not find or load main class src.engine.ComputeEngine.java
Please any help, I have spent many hours on the Internet in vain ??