0

I have a properties my web application needs, but it is not available at package time. So I put it in TOMCAT_HOME/lib and the application finds it with no problem. When I run Tomcat with security manager enabled, the file is never found. I have granted permission to read it, but it is still not found. I am not getting any security error messages, only that the file is missing.

When Tomcat is run with security manager enabled, is the classpath different? Is it more restricted?

  • 1
    How are you trying to load this properties file? A code sample would help. – Christopher Schultz Jul 24 '13 at 22:11
  • I am using the apache-configuration file "PropertiesConfiguration.java". It takes a single parameter which is the name of the properties file to read from. It finds this file on the classpath. PropertiesConfiguration config = new PropertiesConfiguration("myfile.properties"); – user1315531 Jul 25 '13 at 19:44

1 Answers1

0

I found the problem. My code was using:

Thread.currentThread().getContextClassLoader().getResourceAsStream(inputFile);

I needed to grant RuntimePermission to get the class loader.

permission java.lang.RuntimePermission "getClassloader";