Hello,

I am trying to get JCS up and running and I am running into the following
problem.  I have tried setting the config file in my code as well, but I am
having no luck.  I have enclosed the config file and a code snippet as well.

Thanks!
Mike

java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:59)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:84)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:73)
        at java.util.Properties.load(Properties.java:184)
        at
org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCache
Manager.java:149)
        at
org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCache
Manager.java:131)
        at
org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCac
heManager.java:76)
        at
org.apache.jcs.access.GroupCacheAccess.getGroupAccess(GroupCacheAccess.java:
114)
        at
edu.suny.sysadm.common.service.cache.CacheManager.<init>(CacheManager.java:2
1)
        at
edu.suny.sysadm.finance.service.cache.TransactionCodeCacher.<init>(Transacti
onCodeCacher.java:12)
        at _finance._mike._jspService(_mike.java:52)
        at
com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
        at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:348)
        at
oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:498)
        at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:402)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.ja
va:65)
        at
oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
        at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispa
tcher.java:602)
        at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletReq
uestDispatcher.java:308)
        at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandle
r.java:779)
        at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:264)
        at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
        at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableRe
sourcePooledExecutor.java:186)
        at java.lang.Thread.run(Thread.java:479)

public class CacheManager {

    private static CacheManager instance;

    protected static Log log =
Log.getInstance(CacheManager.class.getName());
    
    protected static JCS transactionCodeCache;
    
    public CacheManager() {

        try{
            JCS.setConfigFilename("config/cache.ccf"); 
            transactionCodeCache = JCS.getInstance("transactionCodeCache");
            System.out.println("transactionCodeCache: " +
transactionCodeCache);
        } catch(Exception e){
            log.warn("Could not get an instance of transactionCodeCache: ",
e);
            e.printStackTrace();
        }
        
    }
}



############################################################################
####
#    
# DEFAULT CACHE REGION
#
# Sets the default aux value for any non configured caches.
#
############################################################################
####

jcs.default=DC
jcs.default.cacheattributes=org.apache.stratum.jcs.engine.CompositeCacheAttr
ibutes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engine.me
mory.lru.LRUMemoryCache
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=7200
jcs.default.elementattributes.IdleTime=3600
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true

############################################################################
####
#
# SYSTEM CACHE REGION   
#
# Should be defined for the storage of group attribute list.
#
############################################################################
####

jcs.system.groupIdCache=DC
jcs.system.groupIdCache.cacheattributes=org.apache.stratum.jcs.engine.Compos
iteCacheAttributes
jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.stratum.j
cs.engine.memory.lru.LRUMemoryCache

############################################################################
####
#
# PRE-DEFINED CACHE REGIONS   
#
# Values that are not inherited from Default.
#
############################################################################
####

jcs.region.transactionCodeCache=DC
jcs.region.transactionCodeCache.cacheattributes=org.apache.stratum.jcs.engin
e.CompositeCacheAttributes
jcs.region.transactionCodeCache.cacheattributes.MaxObjects=30
jcs.region.transactionCodeCache.cacheattributes.MemoryCacheName=org.apache.s
tratum.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.transactionCodeCache.cacheattributes.UseMemoryShrinker=true

############################################################################
####
#
# AVAILABLE AUXILIARY CACHES
#
# What way do you want to cache the default and Pre-defined Cache Regions.
#
############################################################################
####

jcs.auxiliary.DC=org.apache.stratum.jcs.auxiliary.disk.indexed.IndexedDiskCa
cheFactory
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.indexed.In
dexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=C:\OC4J_HOME\j2ee\home\cache


Reply via email to