javacachingjcs

JCS failed to load properties


I am using JCS for Caching purposes. I have implemented this on my PC where it works fine but on our Tomcat server as well as on my colleagues PC the error Failed to load properties for name [/cache.ccf] appears.

The jar file has been installed correctly and the cache.ccf file is in the same location as on my PC so I don't understand why it succeeds for me and fails otherwise.

The code I'm using to obtain an instance of the JCS cache is:

JCS.setConfigFilename("/cache.ccf");
printOddsCache = JCS.getInstance(PRINTODDSCACHE_REGION_NAME);

The cache.ccf file contains the following:

jcs.default=
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=200001
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false

*SOLUTION EDIT I rewrote the cache.ccf from scratch and it seems to be working without any error now.


Solution

  • I had similar issue in my project I working on now. Solution from here helped me a lot: How to change JCS cache.ccf file's path? I now that configuration class is less convenient than common properties file, but in this case it's the best solution i've found.