The config file has to be in your classpath.
-----Original Message-----
From: Hoffman, Michael [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 11:02 AM
To: '[EMAIL PROTECTED]'
Subject: NullPointerException
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(CompositeC
ache
Manager.java:149)
at
org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeC
ache
Manager.java:131)
at
org.apache.jcs.engine.control.CompositeCacheManager.getInstance(Composit
eCac
heManager.java:76)
at
org.apache.jcs.access.GroupCacheAccess.getGroupAccess(GroupCacheAccess.j
ava:
114)
at
edu.suny.sysadm.common.service.cache.CacheManager.<init>(CacheManager.ja
va:2
1)
at
edu.suny.sysadm.finance.service.cache.TransactionCodeCacher.<init>(Trans
acti
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(ResourceFilterChai
n.ja
va:65)
at
oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:293)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestD
ispa
tcher.java:602)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Servle
tReq
uestDispatcher.java:308)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHa
ndle
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(Releasab
leRe
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.CompositeCache
Attr
ibutes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engin
e.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.Co
mpos
iteCacheAttributes
jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.strat
um.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.e
ngin
e.CompositeCacheAttributes
jcs.region.transactionCodeCache.cacheattributes.MaxObjects=30
jcs.region.transactionCodeCache.cacheattributes.MemoryCacheName=org.apac
he.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.IndexedDi
skCa
cheFactory
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.indexe
d.In
dexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=C:\OC4J_HOME\j2ee\home\cache
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]