Is it possible to configure a cache without using the cache.ccf file? I've
tried instantiating a CompositeCacheAttributes object, setting its
attributes, and passing to JCS, but I get a NullPointerException.
Here is a snippet of what I'm trying to do:
CompositeCacheAttributes attributes = new
CompositeCacheAttributes();
attributes.setCacheName("udrCache");
attributes.setMaxObjects(50);
attributes.setMemoryCacheName("org.apache.jcs.engine.memory.lru.LRUMemoryCac
he");
attributes.setUseDisk(false);
attributes.setUseLateral(false);
attributes.setUseMemoryShrinker(false);
attributes.setUseRemote(false);
JCS udrCache = JCS.getInstance("udrCache",
createCacheAttributes("udrCache"));
this gives me the following NullPointerException:
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.parseElementAttribu
tes(CompositeCacheConfigurator.java:316) at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(Composi
teCacheConfigurator.java:207)
at
org.apache.jcs.engine.control.CompositeCacheConfigurator.parseRegion(Composi
teCacheConfigurator.java:189)
at
org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheM
anager.java:302)
at
org.apache.jcs.engine.control.CompositeCacheManager.getCache(CompositeCacheM
anager.java:261)
at org.apache.jcs.JCS.getInstance(JCS.java:120)
at testcode.jcs.CacheManager.init(CacheManager.java:31)
at testcode.jcs.CacheManager.<init>(CacheManager.java:24)
at testcode.jcs.CacheManager.getInstance(CacheManager.java:58)
at testcode.jcs.CacheTest.setUp(CacheTest.java:21)
at testcode.jcs.CacheTest.main(CacheTest.java:38)
thanks,
Brett
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>