Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem getting JCS (Java caching system)to work

 
kamal pathak
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!! I've followe dthe guidelines given on the JCS portal and did the
following.
1. Added the required jars (commons-logging, commons-lang,
commons-collections, concurrent.jar and jsc1.2.7.6.jar) to my project
build path
2. scribed the configuration file as,
# 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.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

# AUXILIARY CACHES AVAILABLE

# Primary Disk Cache -- faster than the rest because of memory key storage
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=/usr/opt/bookstore/raf
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
jcs.auxiliary.DC.attributes.MaxKeySize=10000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500


3. Then, when I try to use JCS.getInstance("strRegionName");

I get the following error stack in Eclipse

Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheManager configure
INFO: Creating cache manager from config file: /cache.ccf
Jun 16, 2006 11:16:32 AM org.apache.jcs.utils.threadpool.ThreadPoolManager
loadConfig
INFO: thread_pool.default PoolConfiguration = useBoundary =
[true]boundarySize = [2000]maximumPoolSize = [150]minimumPoolSize =
[4]keepAliveTime = [300000]whenBlockedPolicy = [RUN]startUpSize = [4]
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultAuxValues
INFO: Setting default auxiliaries to DC
Jun 16, 2006 11:16:32 AM org.apache.jcs.config.OptionConverter
instantiateByClassName
SEVERE: Could not instantiate class []
java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jcs.config.OptionConverter.instantiateByClassName(
OptionConverter.java:327)
at org.apache.jcs.config.OptionConverter.instantiateByKey(
OptionConverter.java:177)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseCompositeCacheAttributes(
CompositeCacheConfigurator.java:389)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.setDefaultCompositeCacheAttributes(
CompositeCacheConfigurator.java:169)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.doConfigure(
CompositeCacheConfigurator.java:127)
at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:311)
at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:255)
at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:242)
at org.apache.jcs.engine.control.CompositeCacheManager.configure(
CompositeCacheManager.java:191)
at
org.apache.jcs.engine.control.CompositeCacheManager.getInstance(
CompositeCacheManager.java:119)
at org.apache.jcs.JCS.ensureCacheManager(JCS.java:99)
at org.apache.jcs.JCS.getInstance(JCS.java:64)
at com.thales.src.Cacher.<init>(Cacher.java:16)
at com.thales.src.Main.main(Main.java:43)
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
parseCompositeCacheAttributes
INFO: No special CompositeCacheAttributes class defined for key
[jcs.default.cacheattributes], using default class.
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultCompositeCacheAttributes
INFO: setting defaultCompositeCacheAttributes to [ useLateral = true,
useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1 ]
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultElementAttributes
INFO: setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL =
true, IS_REMOTE = true, IS_ETERNAL = false, MaxLifeSeconds = 21600,
IdleTime = 1800, CreateTime = 1150436792959, LastAccessTime =
1150436792959, getTimeToLiveSeconds() = 21600, createTime = 1150436792959
]
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator parseRegions
INFO: Parsed regions []
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator doConfigure
INFO: Finished configuration in 32 ms.
Jun 16, 2006 11:16:32 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
parseElementAttributes
INFO: No special ElementAttribute class defined for key
[jcs.region.testcache1.elementattributes], using default class.
Jun 16, 2006 11:16:32 AM org.apache.jcs.engine.control.CompositeCache
createMemoryCache
WARNING: Failed to init mem cache, using: LRUMemoryCache
java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jcs.engine.control.CompositeCache.createMemoryCache(
CompositeCache.java:1176)
at org.apache.jcs.engine.control.CompositeCache.<init>(
CompositeCache.java:138)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:306)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:280)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:445)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:384)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:371)
at org.apache.jcs.JCS.getInstance(JCS.java:66)
at com.thales.src.Cacher.<init>(Cacher.java:16)
at com.thales.src.Main.main(Main.java:43)
Jun 16, 2006 11:16:33 AM org.apache.jcs.engine.memory.lru.LRUMemoryCache
initialize
INFO: initialized LRUMemoryCache for testcache1
Jun 16, 2006 11:16:33 AM org.apache.jcs.engine.control.CompositeCache
<init>
INFO: Constructed cache with name: testcache1
Jun 16, 2006 11:16:33 AM org.apache.jcs.config.OptionConverter
instantiateByClassName
SEVERE: Could not instantiate class []
java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jcs.config.OptionConverter.instantiateByClassName(
OptionConverter.java:327)
at org.apache.jcs.config.OptionConverter.instantiateByKey(
OptionConverter.java:177)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseAuxiliary(
CompositeCacheConfigurator.java:499)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:343)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:280)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:445)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:384)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(
CompositeCacheManager.java:371)
at org.apache.jcs.JCS.getInstance(JCS.java:66)
at com.thales.src.Cacher.<init>(Cacher.java:16)
at com.thales.src.Main.main(Main.java:43)
Jun 16, 2006 11:16:33 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator parseAuxiliary
SEVERE: Could not instantiate auxFactory named "DC".
org.apache.jcs.access.exception.CacheException: com.thales.src.Student
Caching Unsuccessful for {Name = Mary Smith, School = null, Address = 456
Oak Drive Pleasantville, CA 94555}
Courses:
{Title = Intro to Foo, Instructor = Jones, Room = null}

org.apache.jcs.access.exception.CacheException: com.thales.src.Student
Caching Unsuccessful for {Name = Joe Smith, School = Engineering, Address
= 456 Oak Drive Pleasantville, CA 94555}
Courses:
{Title = Intro to Foo, Instructor = Jones, Room = null}

Kindly tell know what could be the reason for this problem and how to
solve it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic