I developed a web application that works fine in JBoss 4. Now I need to get it to work in Tomcat 6, but it's hard for me to access some properties file. To read these files, I use the following code:
InputStream is = Thread.currentThread().getContextClassLoader() .getResourceAsStream(fileName); if (is == null) { throw new StartupError("Error loading " + fileName); } properties.load(is);
As I said, it works fine in JBoss 4. But when I deploy my application to tomcat, it does not find the file, assigning the null value to the 'is' variable, which triggers StartupError. The file is located in the WEB-INF / config directory, and webapp is deployed as a war.
Any solution to this problem?
Thank you, Alexander
source share