You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by rathinaganesh <ra...@gmail.com> on 2010/09/08 22:12:59 UTC

Re: Failed to load properties for name


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-APP-NAME>/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.




Graham Leggett wrote:
> 
> Hi all,
> 
> Is there a way of coaxing a more detailed error message out of JCS when 
> it starts up?
> 
> It dies when trying to run this:
> 
>    JCS.setConfigFilename(config);
>    jcs = JCS.getInstance(CACHE_NAME);
> 
> The config file exists and is readable, and is included below.
> 
> I am stuck :(
> 
> java.lang.IllegalStateException: Failed to load properties for name 
> [/Users/minfrin/src/standard/alchemy/development/mx/trunk/alchemy-measure/cache.ccf]
> 	at 
> org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:242)
> 	at org.apache.jcs.JCS.ensureCacheManager(JCS.java:102)
> 	at org.apache.jcs.JCS.getInstance(JCS.java:64)
> 	at 
> alchemy.cluster.dispatch.cache.JCSCacheDispatcher.init(JCSCacheDispatcher.java:113)
> 	at 
> alchemy.cluster.dispatch.cache.JCSCacheDispatcher.<init>(JCSCacheDispatcher.java:89)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> 	at java.lang.Class.newInstance0(Class.java:350)
> 	at java.lang.Class.newInstance(Class.java:303)
> 	at 
> alchemy.cluster.dispatch.DispatcherFactory.getDispatcher(DispatcherFactory.java:116)
> 	at 
> alchemy.cluster.dispatch.DispatcherFactory.getInstance(DispatcherFactory.java:92)
> 	at 
> alchemy.cluster.dispatch.DispatcherFactory.getInstance(DispatcherFactory.java:67)
> 	at 
> alchemy.measure.AbstractThreadedTest.testRunning(AbstractThreadedTest.java:71)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at junit.framework.TestCase.runTest(TestCase.java:168)
> 	at junit.framework.TestCase.runBare(TestCase.java:134)
> 	at junit.framework.TestResult$1.protect(TestResult.java:110)
> 	at junit.framework.TestResult.runProtected(TestResult.java:128)
> 	at junit.framework.TestResult.run(TestResult.java:113)
> 	at junit.framework.TestCase.run(TestCase.java:124)
> 	at junit.framework.TestSuite.runTest(TestSuite.java:232)
> 	at junit.framework.TestSuite.run(TestSuite.java:227)
> 	at 
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
> 	at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
> 	at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> 	at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> 	at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> 	at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> 
> 
> ##############################################################
> ##### Default Region Configuration
> jcs.default=DC
> jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.default.cacheattributes.MaxObjects=100
> jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> 
> ##############################################################
> ##### CACHE REGIONS
> jcs.region.cluster=DC
> jcs.region.cluster.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.region.cluster.cacheattributes.MaxObjects=1000
> jcs.region.cluster.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> 
> ##############################################################
> ##### AUXILIARY CACHES
> # Indexed Disk Cache
> jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
> jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
> jcs.auxiliary.DC.attributes.DiskPath=/Users/minfrin/cache/indexed-disk-cache
> #jcs.auxiliary.DC.attributes.DiskPath=/udd001/app/alchemy/cache/indexed-disk-cache
> jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
> jcs.auxiliary.DC.attributes.MaxKeySize=10000
> jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
> jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true
> jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500
> 
> Regards,
> Graham
> --
> 
>  
> 

-- 
View this message in context: http://old.nabble.com/Failed-to-load-properties-for-name-tp14334069p29642191.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