jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Andersen <lorinh...@gmail.com>
Subject NullPointerExceptions with JCS.getInstance
Date Sat, 13 Aug 2005 17:54:02 GMT
I've got high hopes for using JCS in my webapp, it looks like it will
make a great addition but I've been spinning my wheels fruitlessly for
several hours now trying to get it working...

I've got jcs-1.2.6.5.jar in tomcat's common/lib directory and the
following simplest possible cache.ccf file in WEB-INF/classes/ of my
webapp directory
-----------------------------------
# DEFAULT CACHE REGION   

jcs.default=
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
-------------------------

However, on startup, when execution reaches
JCS.getInstance("pageCache"), this NPE is thrown.
---------------------------
java.lang.NullPointerException
	at java.util.Properties$LineReader.readLine(Unknown Source)
	at java.util.Properties.load(Unknown Source)
	at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:168)
	at org.apache.jcs.JCS.ensureCacheManager(JCS.java:105)
	at org.apache.jcs.JCS.getInstance(JCS.java:64)
	at org.jandersen.bliki.dao.PGWikiBackend.<init>(PGWikiBackend.java:41)
	etc...
-------------------------------
any subsequent page requests yield a slightly different variation:
--------------------------
java.lang.NullPointerException
	at org.apache.jcs.config.OptionConverter.findAndSubst(OptionConverter.java:252)
	at org.apache.jcs.config.OptionConverter.instantiateByKey(OptionConverter.java:147)
	at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseElementAttributes(CompositeCacheConfigurator.java:317)
	at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:216)
	at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(CompositeCacheConfigurator.java:201)
	at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:303)
	at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:266)
	at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:259)
	at org.apache.jcs.JCS.getInstance(JCS.java:66)
	at org.jandersen.bliki.dao.PGWikiBackend.<init>(PGWikiBackend.java:41)
	etc...
------------------------------
I feared at one point that I couldn't call
JCS.getInstance("pageCache") without having a pageCache region so I
tried using a copy of the cache.ccf file based on the "Basic Web
Example" from the site changing only "bookCache" to "pageCache" but
that didn't make any difference regarding this error.
I even tried a different java version (the above was with jre1.5.0_04)
and got this variation of the NPE when I ran tomcat 5.0.19 with j2sdk
1.4.2_09
------------------------------------
java.lang.NullPointerException
	at java.io.Reader.<init>(Reader.java:61)
	at java.io.InputStreamReader.<init>(InputStreamReader.java:80)
	at java.util.Properties.load(Properties.java:266)
	at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:168)
	at org.apache.jcs.JCS.ensureCacheManager(JCS.java:105)
	at org.apache.jcs.JCS.getInstance(JCS.java:64)
	at org.jandersen.bliki.dao.PGWikiBackend.<init>(PGWikiBackend.java:41)
	etc.........
------------------------------------

I'm a big fan of the jakarta projects can anyone shed some light on
how to fix this?  I noticed someone had a similar problem when trying
to use the remote auxiliary...  I'm just shooting for the simplest use
scenario.  If I read the posts correctly, the only way they solved the
problem was by patching CompositeCacheManager...

---------------------------------------------------------------------
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