Hmmm.... I thought that with web apps one should use the ServletContext
methods [url=http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getResource(java.lang.String)]getResource[/url] and [url=http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getResourceAsStream(java.lang.String)]getResourceAsStream[/url]
-- note, not the Class methods with the same name. From the API for these methods:
<quote>
This method has a different purpose than java.lang.Class.getResource, which looks up resources based on a class loader. This method does not use class loaders.
</quote>
In regard to the classloader context, I used this for the Servlet component: InputStream is = getServletContext().getResourceAsStream(filename);
Since I am referencing the same config file for the application component that sits on the desktop, i had to use something different since it is not a servlet:
InputStream is = (ClassLoader.getSystemClassLoader()).getResourceAsStream(filename);
Im not sure if the latter example will work with the servlet, but I will check next time I deploy. I'm sure it would.