Is anybody out there know how to run Orion with a security manager and a
policy file?
I have a very simple servlet which whose init method looks like the
following:
String parameter;
public void init(ServletConfig config) throws ServletException
{
super.init(config);
parameter = config.getInitParameter("log-file-path");
try {
File file = new File(parameter);
if (!file.exists() || !file.isDirectory() )
file.mkdirs();
}
catch(Exception e )
{
System.err.println("Failed to verify directory: " +
parameter);
System.err.println(e.getMessage());
e.printStackTrace(System.err);
}
}
I start Orion as follows:
java -Djava.security.manager -Djava.security.policy
==file:/C:/Orion/java.policy -jar orion.jar
The java.policy file is:
grant {
permission java.security.AllPermission ;
};
But I always get an AccessControlException in the file.exists() call in
the init method.
Thanks,
Daniel G. Chandran
Reuters, Inc.