jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sankara Subramanian Ramakrishnan" <sankar...@aditi.com>
Subject RE: NullPointerExceptions with JCS.getInstance
Date Tue, 16 Aug 2005 02:42:32 GMT
James,

can you let us know your web server and JDK versions.

- Sankar

-----Original Message-----
From: James Andersen [mailto:lorinho99@gmail.com]
Sent: Monday, August 15, 2005 7:09 PM
To: JCS Users List
Subject: Re: NullPointerExceptions with JCS.getInstance


Sankara,
   Well, in frustration I switched over to ehcache only to find that
my webapp wasn't picking up the ehcache.xml that is also supposed to
go just under the classes directory.  Ehcache does at least have a
failsafe configuration but my real problem is that for some reason
these configuration files I'm putting under WEB-INF/classes aren't
getting picked up...  I realize this is no longer a JCS specific
problem but if anyone has a tip I'd be much obliged...
Thanks,
James

On 8/15/05, Sankara Subramanian Ramakrishnan <sankarasr@aditi.com> wrote:
> James,
> 
> I get a error similar to your error below if i remove the cache.ccf from the WEB-INF/Classes/
within my webapp.
> 
> 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)
> 
> 
> if i have the file in that particular folder, i don't get any error.
> If possible, send the webapp folder. Ill try to deploy on my machine and give an attempt.
> 
> - Sankar
> 
> -----Original Message-----
> From: Lorinho [mailto:james.j.andersen@gmail.com]
> Sent: Monday, August 15, 2005 3:55 PM
> To: JCS Users List
> Subject: Re: NullPointerExceptions with JCS.getInstance
> 
> 
> WEB-INF/classes/ within my webapp
> -James
> 
> Sankara Subramanian Ramakrishnan wrote:
> 
> >James,
> >
> >Where have you placed the cache.ccf file on the disk ?
> >-Sankar
> >
> >________________________________
> >
> >From: Lorinho [mailto:james.j.andersen@gmail.com]
> >Sent: Sat 8/13/2005 4:57 PM
> >To: JCS Users List
> >Subject: Re: NullPointerExceptions with JCS.getInstance
> >
> >
> >
> >Sankar,
> >    Thanks for the suggestion; I gave it a try but I'm still getting the
> >same error.  I had previously tried using the cache.ccf from "Basic Web
> >Example" on the site only changing "bookCache" to "pageCache" but that
> >didn't work either.  The  NullPointerException I'm getting when I first
> >access the page is thrown from the load method of java.util.Properties
> >which seems to indicate that JCS is somehow not finding or otherwise
> >unable to load my cache.ccf file but I really don't know what's going on.
> >Thanks! Any other ideas?
> >-James
> >
> >Sankara Subramanian Ramakrishnan wrote:
> >
> >
> >
> >>Hi There,
> >>
> >>You need to add this is your cache.ccf since you are trying to load  "pageCache"
> >>
> >>jcs.pageCache=
> >>jcs.pageCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> >>jcs.pageCache.cacheattributes.MaxObjects=1000
> >>jcs.pageCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> >>
> >>- Sankar
> >>
> >>
> >>      -----Original Message-----
> >>      From: James Andersen [mailto:lorinho99@gmail.com]
> >>      Sent: Sat 8/13/2005 11:24 PM
> >>      To: jcs-users@jakarta.apache.org
> >>      Cc:
> >>      Subject: NullPointerExceptions with JCS.getInstance
> >>
> >>
> >>
> >>      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
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> >
> >
> >
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
>

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


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