Hi,

I have two questions. I have been working with a stand alone app which finds a properties
file this way. This code is in a class, which is bundled in a jar.

private static void setupProperties()
{
InputStream fileReference = ClassLoader.getSystemResourceAsStream(PROPERTIES_FILE);
}

This works fine when run on a command line, but in Tomcat the application can not find
the properties file.

I put the following code in a class in a non-static method in a class, which is bundled in a jar. This works find on both the command line and in Tomcat, my application can find
the properties file.

private void setupPropertiesInWebapp()
{
InputStream fileReference = this.getClass().getClassLoader().getResourceAsStream(PROPERTIES_FILE);
}

In Tomcat the properties file lives in $CATALINA_HOME/webapp/myapp/WEB-INF/classes/


My Questions are
1) Is there a way to make the first example work in Tomcat, and have my application find
the properties file?
2) Why doesn't ClassLoader.getSystemReasourceAsStream work in Tomcat? Does it not see the
correct classpath?

Thanks
ERIC

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to