RMI Scurity Problem
Submitted by AhmedEltanahy on Tue, 2006-05-16 22:13.
When i want to run TicTacToe program this program user RMI technology this error face me and i want the reason of this error and how i slove it i wrote the error as it is
The Error:
Exception in thread "main" java.AccessControlException: access denied (java.net.SoketPermission 127.0.0.1:1099 connect,resolve)
i wish to find the solution






This is a security problem,
This is a security problem, as this exception is thrown when the client or server is not allowed to access the RMI registry. To do that you should create a permission file.
see this, this file grant all permissions, put this on C:\ drive, save it as <mypolicy.policy>
grant codeBase "file:C:/RMI/-" { permission java.security.AllPermission; };Best wishes, Shimaa
More on the reason...
You can never trust remote code. And remote objects definitely mean remote code. Java's sandbox, represented by the JVM and its security manager, prevents any such code from accessing sensitive resources on the machine (e.g. sockets, file system, etc.). You have to explicity declare, via a policy file, what is allowed and what is not. The java.security.policy property is used to reference a policy file in which these are defined.
''There are 10 kinds of people in the world: those who can count in binary, and those who can't.''