Has anyone experienced an AccessControlException
while creating and binding an RMI Server from a
Servlet. The particular action it fails on seems
to be random. Sometimes, it's setting a Property
and at other times it fails when binding the RMI
Server to a port.
Here is my java.policy file:
grant {
permission java.security.AllPermission;
};
and i'm setting the policyfile in code
String policyFile = Config.nlRoot.value() + "/conf/common/java.policy";
Security.setProperty("java.security.policy", policyFile);
if (System.getSecurityManager() == null){
System.setSecurityManager(new java.rmi.RMISecurityManager());
}
and i'm setting the codebase in code
String codebase = "file://" + Config.nlRoot.value() + "/WEB-INF/classes/";
Security.setProperty("java.rmi.server.codebase", codebase);
however, an AccessControlException inevitably occurs during
the creation of the RMI Server. I'm being a bit vague here
because the manifestation of my issue is random.
Thanks,
Ted Rice