You are doing explicit cache creation. I'm using jcache.ccf in src/main/resources:
jcs.region.testCache=DC jcs.region.testCache.cacheattributes=org.apache.commons.jcs.engine.CompositeCacheAttributes jcs.region.testCache.cacheattributes.MaxObjects=200001 jcs.region.testCache.cacheattributes.MemoryCacheName=org.apache.commons.jcs.engine.memory.lru.LRUMemoryCache jcs.region.testCache.cacheattributes.UseMemoryShrinker=true jcs.region.testCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600 jcs.region.testCache.cacheattributes.ShrinkerIntervalSeconds=60 jcs.region.testCache.elementattributes=org.apache.commons.jcs.engine.ElementAttributes jcs.region.testCache.elementattributes.IsEternal=false jcs.region.testCache.elementattributes.MaxLife=600 jcs.region.testCache.elementattributes.IdleTime=1800 jcs.region.testCache.elementattributes.IsSpool=true jcs.region.testCache.elementattributes.IsRemote=true jcs.region.testCache.elementattributes.IsLateral=true Sep 04, 2015 12:02:37 PM org.apache.commons.jcs.engine.control.CompositeCache <init> INFO: Constructed cache with name [testCache] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 100, maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ] It doesn't appear to pickup my configuration since I'm using MaxObjects=200001. Is there a different place or name for the ccf? On Fri, Sep 4, 2015 at 2:40 AM, Romain Manni-Bucau <[email protected]> wrote: > Hi, > > final CachingProvider cachingProvider = Caching.getCachingProvider(); > final CacheManager cacheManager = cachingProvider.getCacheManager(); > cacheManager.createCache("c1", new MutableConfiguration<String, String>()); > cacheManager.createCache("c2", new MutableConfiguration<String, String>()); > final Collection<String> actualNames = new ArrayList<String>(2); > for (final String s : cacheManager.getCacheNames()) > { > actualNames.add(s); > } > assertEquals(2, actualNames.size()); > assertEquals(new HashSet<String>(asList("c1", "c2")), new > HashSet<String>(actualNames)); > cachingProvider.close(); > > works fine so you have a setup issue somewhere - or you dont use the > same cache manager. > > > > Romain Manni-Bucau > @rmannibucau <https://twitter.com/rmannibucau> | Blog > <http://rmannibucau.wordpress.com> | Github < > https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2015-09-04 3:52 GMT+02:00 sgjava <[email protected]>: > > > getCacheManager().getCacheNames() is not working with JCS. I get an empty > > org.apache.commons.jcs.jcache.ImmutableIterable. The Ehcache provider > > correctly returns a String iterator with the cache names. My tests run > > fine, > > but this is a good way to check that your configuration is picked up with > > multiple caches defined. > > > > > > > > -- > > View this message in context: > > > http://tomee-openejb.979440.n4.nabble.com/commons-jcs-jcach-getCacheNames-not-working-tp4676111.html > > Sent from the TomEE Users mailing list archive at Nabble.com. > > > -- Steven P. Goldsmith
