I'm running Tomcat 5.5.9 and I'm trying to load a properties file, "sql.properties" from within my application. I searched the previous threads and tried those suggestions, but it's just not working for me. Here is the code that I am trying to run.
It is finding that inStream is null. I tried putting sql.properties in the WEB-INF/classes directory as well as the directory that this class is in and it's still not finding it. Any ideas? Thanks.
Look at the third item on this list for instructions on loading properties files using ServletContext.getResourceAsStream. Tomcat uses custom classloaders and may not work the way your expecting it to.
The link also shows how to load the properties file as a resourceBundle.