After adding jcs-cache line as below:
<class name="com.omnet.bean.Device" table="device">
<jcs-cache usage="read-write"/>
<id name="devId">
<column name="dev_id" sql-type="int" not-null="true"/>
<generator class="native"/>
</id>
...
</class>
then error occurs as beow:
08:36:54,490 INFO [Binder] Mapping class: com.omnet.bean.Device -> device
08:36:54,490 INFO [Configuration] creating JCS cache region: com.omnet.bean.Device, usage: read-write
08:36:54,508 ERROR [Configuration] Could not configure datastore from input stream
java.lang.NullPointerException
at org.apache.jcs.config.OptionConverter.findAndSubst(OptionConverter.java:241)
at org.apache.jcs.config.OptionConverter.instantiateByKey(OptionConverter.java:132)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseElement
Attributes(CompositeCacheConfigurator.java:316)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:207)
at org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(
CompositeCacheConfigurator.java:189)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(Composit
eCacheManager.java:302)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:261)
at org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheManager.java:254)
at org.apache.jcs.JCS.getInstance(JCS.java:103)
at net.sf.hibernate.cache.JCSCache.setRegion(JCSCache.java:22)
at net.sf.hibernate.cfg.Configuration.createJCSCache(Configuration.java:906)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:282)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1094)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:273)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:160)
at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:131)
.......
if remove <jcs-cache usage="read-write"/> all works fine !
the cache.ccf is as below:
# DEFAULT CACHE REGION (memory cache)
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=2000
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=240
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=false
jcs.default.elementattributes.IsLateral=false
# System CACHE REGION
jcs.system.groupIdCache=DC
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
#Auxiliary CACHE (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=cache
|