Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 70382 invoked from network); 16 Aug 2005 03:54:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2005 03:54:18 -0000 Received: (qmail 93378 invoked by uid 500); 16 Aug 2005 03:54:18 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 93367 invoked by uid 500); 16 Aug 2005 03:54:17 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Received: (qmail 93354 invoked by uid 99); 16 Aug 2005 03:54:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 20:54:17 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FROM_ENDS_IN_NUMS,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lorinho99@gmail.com designates 64.233.162.200 as permitted sender) Received: from [64.233.162.200] (HELO zproxy.gmail.com) (64.233.162.200) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 20:54:37 -0700 Received: by zproxy.gmail.com with SMTP id 40so801276nzk for ; Mon, 15 Aug 2005 20:54:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hMJ4l9lT4d4xB2k/iLlY4LEWYU6I69UfXEVt8iGqCtSQg2M15XDy/gB/jANsBmipcdb9uo18M0iLH2ziWMxs3F5c9mN+l+1b/t7+J+FaEIhOgQ4u/K1vUhNa3mzIejf0+F7Ks7NKuA7SkokopcWYdjN229UlC1BYdZYaOsa9PIA= Received: by 10.36.126.12 with SMTP id y12mr5583886nzc; Mon, 15 Aug 2005 20:54:15 -0700 (PDT) Received: by 10.36.224.58 with HTTP; Mon, 15 Aug 2005 20:54:14 -0700 (PDT) Message-ID: Date: Mon, 15 Aug 2005 22:54:14 -0500 From: James Andersen To: JCS Users List Subject: Re: NullPointerExceptions with JCS.getInstance In-Reply-To: <20050816034146.47653.qmail@web30504.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050816034146.47653.qmail@web30504.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Aaron, Thanks for the info... The following article is what led me astray: http://www.onjava.com/pub/a/onjava/2003/12/23/caching.html It describes placing the jcs jar in the common directory... I did just now verify that this was my problem by switching my code back to use JCS, getting a ClassDefNotFound error because of a missing concurrent.jar, hunting all over for said jar, and finally getting JCS to work successfully... Once I fixed the ehcache problem by moving that jar I was 95% sure that that was my problem with JCS as well but I just wanted to verify it... It was indeed the problem. I'll be careful about sticking libraries in the common directory as per your advice from here on out.. Thanks, James On 8/15/05, Aaron Smuts wrote: > If you put a jar in the common directory, then it will > use a classloader that can't see the web app. >=20 > JCS is using the classloader that loaded the jcs > classes. If the jcs jar is in the common dir, then it > can't find the file in you web app directory. >=20 > I'd recommend not using the common/lib directory for > much of anything. It ties your apps too tightly > together, and well you might as well be in JBoss > classloader hell. . . . >=20 > In any case, all JCS needs to do is try to load the > properties using the current thread's classloader and > everything would be fine for your configuration. >=20 > That change will be in the next patch release. I've > already put in better config error messaging . . . >=20 > Cheers, >=20 > Aaron >=20 > --- James Andersen wrote: >=20 > > Sankar, > > I'm primarily using tomcat 5.0.19 and > > jre1.5.0_04 but as I > > mentioned in my first email I did try a few other > > combinations... > > However, I think I may possibly have found my > > problem. I still > > haven't gone back to JCS yet to try this but I fixed > > my ehcache > > problem by moving my ehcache.jar from > > /common/lib to > > /WEB-INF/lib. At that point ehcache > > (a fork of JCS > > right?) was able to find and use the config file I > > created. I think > > the root cause has something to do with the way > > tomcat classloaders > > work and frankly I more interested in getting on > > with my webapp than > > delving into that but I'm thinking this has to be > > the reason I had > > some much trouble with my cache.ccf file because I > > had the JCS jar > > /common/lib as well... Hopefully > > someone else can learn > > from my mistake... Is the jcs jar only supposed to > > go in the > > WEB-INF/lib directory? Did I miss that in the > > documentation? > > Thanks, > > James > > > > On 8/15/05, Sankara Subramanian Ramakrishnan > > wrote: > > > 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 > > 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.(Reader.java:61) > > > > >> at > > > java.io.InputStreamReader.(InputStreamReader.java:80) > > > > >> at > > java.util.Properties.load(Properties.java:266) > > > > >> at > > > org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCa= cheManager.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=3D > > > > > > > >>jcs.pageCache.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAtt= ributes > > > > >>jcs.pageCache.cacheattributes.MaxObjects=3D1000 > > > > > > > >>jcs.pageCache.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.engine.m= emory.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=3D > > > > >> > > > jcs.default.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAttribu= tes > > > > >> > > jcs.default.cacheattributes.MaxObjects=3D1000 > > > > >> > > > jcs.default.cacheattributes.MemoryCacheName=3Dorg.apache.jcs.engine.memor= y.lru.LRUMemoryCache > > > > >> ------------------------- > > > > >> > > > > >> However, on startup, when execution > > reaches > > > =3D=3D=3D message truncated =3D=3D=3D >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jcs-users-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-users-help@jakarta.apache.org