You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by Tim Cronin <tc...@interwoven.com> on 2005/08/30 23:43:30 UTC

cache.ccf resolution via classpath?

I'm trying to write a simple command line example of jcs.

 

Debugging in Eclipse I'm getting an NPE when trying to load the cache
props file.

 

In digging in the code I found that the file is being resolved in
CompositeCacheManager

 

By calling        InputStream is = getClass().getResourceAsStream(
propFile ); (line 165)

 

I did a simple test with the following code 

 

      ClassLoader c = CompositeCacheManager.class.getClassLoader();

      while (c != null)

      {

        System.err.println(c.getClass().getName());

 

        c = c.getParent();

      }

 

 

 
System.err.println(CompositeCacheManager.class.getResource("cache.ccf"))
;

 
System.err.println(Thread.currentThread().getContextClassLoader().getRes
ource("cache.ccf"));

 

The output yielded was

 

sun.misc.Launcher$AppClassLoader

sun.misc.Launcher$ExtClassLoader

null

file:/C:/src/projects/workarea/jcs/classes/cache.ccf

 

I change the above line CompositeCacheManager to use the current thread
call and things

Seemed to work is there something I'm doing wrong?

 

It would be nice if the path might be left up the user.