| Author |
AccessControlException hocuspocus
|
Juhan Voolaid
Ranch Hand
Joined: Nov 18, 2003
Posts: 179
|
|
When I try to make a RMI connection with my client application, I get AccessControlException.
Solution for that would be configuring the security policy like that:
java -jar -Djava.security.policy=client.policy runme.jar
The client.policy file:
But the instructions clearly say that: "Your programs must not require use of command line property specifications".
So what are my options?
I have read that security policy is only required when the stubs are not provided, but I have included them - how do I test that anyway?
|
 |
Juhan Voolaid
Ranch Hand
Joined: Nov 18, 2003
Posts: 179
|
|
Ok, found it.
The problem was, that I set new security manager in my code:
System.setSecurityManager(new RMISecurityManager());
Just had to delete it and it worked fine. I accidentally copied that code from RMI tutorial.
|
 |
K. Tsang
Ranch Hand
Joined: Sep 13, 2007
Posts: 1219
|
|
if you use RMI and have the security manager (which is forbidden) you automatically failed.
|
K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
|
 |
Daniel Salomons
Greenhorn
Joined: Oct 07, 2004
Posts: 5
|
|
Hi everybody,
I hav the Bodgitt & Scarper assignment.
I must not require the installation of a security manager. Does this mean I must not include a policy file?
TIA
Gr Daniel
|
 |
Juhan Voolaid
Ranch Hand
Joined: Nov 18, 2003
Posts: 179
|
|
Yep. Without specifying any security policy and not doing that:
System.setSecurityManager(new RMISecurityManager());
... my application works without problems.
|
 |
 |
|
|
subject: AccessControlException hocuspocus
|
|
|