Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 42908 invoked from network); 8 Sep 2010 20:10:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 20:10:27 -0000 Received: (qmail 23636 invoked by uid 500); 8 Sep 2010 20:10:27 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 23569 invoked by uid 500); 8 Sep 2010 20:10:26 -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 23555 invoked by uid 99); 8 Sep 2010 20:10:26 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 20:10:26 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 20:09:55 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OtQxa-0002en-OH for jcs-users@jakarta.apache.org; Wed, 08 Sep 2010 13:09:34 -0700 Message-ID: <29642189.post@talk.nabble.com> Date: Wed, 8 Sep 2010 13:09:34 -0700 (PDT) From: rathinaganesh To: jcs-users@jakarta.apache.org Subject: RE: JCS.setConfigFilename In-Reply-To: <9DD36C99332AB7438F8D73C048D8C62C010B2D73@sneezy.ad.e-dialog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: rathinaganesh.tech@gmail.com References: <483DA6C6.4070702@nektra.com> <9DD36C99332AB7438F8D73C048D8C62C010B2D73@sneezy.ad.e-dialog.com> X-Virus-Checked: Checked by ClamAV on apache.org Greetings, I am having the same issue. I have the cache.ccf file under the classes folder in WEB-INF in my web application. Here is the sample of my Manager class, which loads the JCS cache. --------------------- public class CacheManager { private static CacheManager instance; private static int checkedOut = 0; private static JCS processedSlaCache; private CacheManager() { try { // JCS.setConfigFilename("cache.ccf"); System.out.println("Trying to load the cache...."); processedSlaCache = JCS.getInstance("slaCache"); } catch (Exception e) { // Handle cache region initialization failure e.printStackTrace(); } // Do other initialization that may be necessary, such as getting // references to any data access classes we may need to populate // value objects later } /** * Singleton access point to the manager. */ public static CacheManager getInstance() { synchronized (CacheManager.class) { if (instance == null) { System.out.println("instance null"); instance = new CacheManager(); } } synchronized (instance) { instance.checkedOut++; } return instance; } } --------------------- Here is the sample of my cache file, cache.ccf under /WEB-INF/classes/cache.ccf # DEFAULT CACHE REGION jcs.default=DC jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.default.cacheattributes.MaxObjects=1000 jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache jcs.default.cacheattributes.UseMemoryShrinker=false jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes jcs.default.elementattributes.IsEternal=false jcs.default.elementattributes.MaxLifeSeconds=21600 jcs.default.elementattributes.IdleTime=1800 jcs.default.elementattributes.IsSpool=true jcs.default.elementattributes.IsRemote=true jcs.default.elementattributes.IsLateral=true # PRE-DEFINED CACHE REGIONS jcs.region.slaCache=DC jcs.region.slaCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes jcs.region.slaCache.cacheattributes.MaxObjects=1000 jcs.region.slaCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache jcs.region.slaCache.cacheattributes.UseMemoryShrinker=false jcs.region.slaCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600 jcs.region.slaCache.cacheattributes.ShrinkerIntervalSeconds=60 jcs.region.slaCache.cacheattributes.MaxSpoolPerRun=500 jcs.region.slaCache.elementattributes=org.apache.jcs.engine.ElementAttributes jcs.region.slaCache.elementattributes.IsEternal=false --------------------------------------------- Here is the error message ..... 11:28:25,203 INFO [CompositeCacheManager] Creating cache manager from config file: /cache.ccf 11:28:25,218 INFO [STDOUT] 11:28:25,218 ERROR [CompositeCacheManager] Failed to load properties for name [/cache.ccf] 11:28:25,218 ERROR [STDERR] java.lang.IllegalStateException: Failed to load properties for name [/cache.ccf] 11:28:25,218 ERROR [STDERR] at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:242) 11:28:25,218 ERROR [STDERR] at org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:194) 11:28:25,218 ERROR [STDERR] at org.apache.jcs.engine.control.CompositeCacheManager.getInstance(CompositeCacheManager.java:122) 11:28:25,218 ERROR [STDERR] at org.apache.jcs.JCS.ensureCacheManager(JCS.java:96) 11:28:25,218 ERROR [STDERR] at org.apache.jcs.JCS.getInstance(JCS.java:64) Any help in this regard would be highly appreciated. Thanks, Ganesh. jordiang wrote: > > JCS looks for the file at the root of the classpath. > > If your code compiles to the directory "classes\com\nektra\ > ...\MyClass.class", then make sure the file cache.ccf is located right > under "classes\" > > If you are creating a JAR file with your classes, include the cache.ccf > in the top directory. > > > -Jorge > > -----Original Message----- > From: Mauro S. Asprea [mailto:mauro.asprea@nektra.com] > Sent: Wednesday, May 28, 2008 2:39 PM > To: jcs-users@jakarta.apache.org > Subject: JCS.setConfigFilename > > Hi, I'm having aa issue when trying to set the config.ccf file path. > My code is: > > JCS.setConfigFilename("cache.ccf"); > cache = JCS.getInstance("default"); > > And I'm getting the following exception > > Failed to load properties for name [cache.ccf] > java.lang.IllegalStateException: Failed to load properties for name > [cache.ccf] > at > > org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeC > acheManager.java:242) > at org.apache.jcs.JCS.ensureCacheManager(JCS.java:102) > at org.apache.jcs.JCS.getInstance(JCS.java:64) > > I tried setting the JCS.setConfigFilename with a absolute path like > "c:\mydir\mifile.ccf and the exception keeps throwing. > > So I donwloaded the code of JCS and noted that the > CompositeCacheManager.configure didn't read for my dir path. How can I > make him to read the file from I want to , or where in my project dirs I > > have to put the config file? > > I don't how to solve this... any clue? > > Thanks! > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jcs-users-help@jakarta.apache.org > > > -- View this message in context: http://old.nabble.com/JCS.setConfigFilename-tp17519214p29642189.html Sent from the JCS - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-users-help@jakarta.apache.org