looks like behaving correctly according your config which is initialized by the backing JCS cache manager - not the JCache facade one.
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-15 12:44 GMT-07:00 Steve Goldsmith <[email protected]>: > It's there https://github.com/sgjava/jcache-tomee. CacheBeanTest has been > modified not to use testCache = > cacheBean.getCacheManager().getCache("testCache"), only annotations. You > will see from the logging that the default cache is created several times. > This makes no sense. I'll switch back to EHcache and see what it does while > you are looking at the source. UserServiceJCacheTest will fail because it > compares cache with cacheBean.getCacheManager().getCache("testCache"). > > > > > On Tue, Sep 15, 2015 at 2:35 PM, Romain Manni-Bucau <[email protected] > > > wrote: > > > can you push it all to github? maybe some semantic issue in our > > communication so would check it on a running example > > > > > > 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-15 10:48 GMT-07:00 sgjava <[email protected]>: > > > > > OK, I tried the snapshot again and it still creates a default cache > > trying: > > > > > > @PostConstruct > > > public void init() { > > > log.info("PostConstruct"); > > > cachingProvider = Caching.getCachingProvider(); > > > //cacheManager = cachingProvider.getCacheManager(); > > > log.info("getCacheManager"); > > > cacheManager = cachingProvider.getCacheManager(new File( > > > "src/main/resources/jcache.ccf").toURI(), > > > Thread.currentThread().getContextClassLoader(), > > > cachingProvider. > > > getDefaultProperties()); > > > } > > > > > > It still creates a default cache after calling getCacheManager: > > > > > > Sep 15, 2015 1:49:06 PM com.codeferm.jcache.tomee.CacheBean init > > > *INFO: PostConstruct* > > > Sep 15, 2015 1:49:06 PM com.codeferm.jcache.tomee.CacheBean init > > > *INFO: getCacheManager* > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.utils.threadpool.ThreadPoolManager loadConfig > > > INFO: thread_pool.default PoolConfiguration = useBoundary = [true] > > > boundarySize = [2000] maximumPoolSize = [150] minimumPoolSize = [4] > > > keepAliveTime = [300000] whenBlockedPolicy = [RUN] startUpSize = [4] > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > setDefaultAuxValues > > > INFO: Setting default auxiliaries to null > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > parseCompositeCacheAttributes > > > INFO: No special CompositeCacheAttributes class defined for key > > > [jcs.default.cacheattributes], using default class. > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > setDefaultCompositeCacheAttributes > > > INFO: setting defaultCompositeCacheAttributes to [ useLateral = true, > > > useRemote = true, useDisk = true, maxObjs = 100, maxSpoolPerRun = -1, > > > diskUsagePattern = SWAP, spoolChunkSize = 2 ] > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > parseElementAttributes > > > INFO: No special ElementAttribute class defined for key > > > [jcs.default.elementattributes], using default class. > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > setDefaultElementAttributes > > > INFO: setting defaultElementAttributes to [ IS_LATERAL = true, > IS_SPOOL = > > > true, IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, > IdleTime > > = > > > -1, CreateTime = 1442339346194, LastAccessTime = 1442339346194, > > > getTimeToLiveSeconds() = -1, createTime = 1442339346194 ] > > > Sep 15, 2015 1:49:06 PM > > > > org.apache.commons.jcs.engine.memory.AbstractDoubleLinkedListMemoryCache > > > initialize > > > INFO: initialized MemoryCache for testCache > > > Sep 15, 2015 1:49:06 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 = 200001, > > > maxSpoolPerRun = -1, diskUsagePattern = SWAP, spoolChunkSize = 2 ] > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > parseAuxiliary > > > SEVERE: Could not instantiate auxFactory named "DC". > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > parseRegions > > > INFO: Parsed regions [testCache] > > > Sep 15, 2015 1:49:06 PM > > > org.apache.commons.jcs.engine.control.CompositeCacheConfigurator > > > doConfigure > > > INFO: Finished configuration in 13 ms. > > > > > > testCache = cacheBean.getCacheManager().getCache("testCache") also > > creates > > > a > > > default cache. > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://tomee-openejb.979440.n4.nabble.com/JCache-annotations-using-default-cache-instead-of-MutableConfiguration-or-configuration-file-tp4676198p4676225.html > > > Sent from the TomEE Users mailing list archive at Nabble.com. > > > > > > > > > -- > Steven P. Goldsmith >
