jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: cache.ccf resolution via classpath?
Date Tue, 30 Aug 2005 21:57:38 GMT
The change to use the thread's classloader should be in the 1.2.6.7
release.

I've never had any problems running tests in eclipse after the cache.ccf
file gets copied to the target directory.

Aaron

> -----Original Message-----
> From: Tim Cronin [mailto:tcronin@interwoven.com]
> Sent: Tuesday, August 30, 2005 5:44 PM
> To: jcs-users@jakarta.apache.org
> Subject: 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.
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message