[Opensymphony-oscache] Finding oscache.properties

Tobin Juday <[email protected]> Wed, 24 Aug 2005 10:21:21 CDT
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <12733056.1124897839025.JavaMail.os-j2ee@opensymphony01.contegix.com>
I've been working fairly successfully with OSCache on the Java side of things, and now I'm looking to transition into a web app.  I've placed the oscache.jar in my lib directory, and the oscache.properties file in the WEB-INF/classes directory, so that it will be found in the classpath.

However, upon startup, OSCache "complains" that it can't find the /oscache.properties file.  I've verified the file is out in the WEB-INF/classes directory and that it's spelled correctly.

I'm using WebLogic 8.1 (SP4).  We have an xwork.xml and a log4j.xml in this same directory, and they're both getting picked up by their respective libraries.

It seems to be this code that is causing the problem (found in the loadProps() method of the Config class):

[code]
        InputStream in = null;

        try {
            in = Config.class.getResourceAsStream(PROPERTIES_FILENAME);
            properties.load(in);
            log.info("Properties " + properties);
        } catch (Exception e) {
            log.error("Error reading " + PROPERTIES_FILENAME + " in CacheAdministrator.loadProps() " + e);
            log.error("Ensure the " + PROPERTIES_FILENAME + " file is readable and in your classpath.");
        } finally {
            try {
                in.close();
            } catch (Exception e) {
                // Ignore errors that occur while closing file
            }
        }
[/code]

The problem is that [code]Config.class.getResourceAsStream(PROPERTIES_FILENAME)[/code] is returning a null.  Any ideas about what's going on here?

Tobin

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=6026&messageID=13689#13689