我有这个 ehCache 的配置:
<ehcache>
<defaultCache
name="defaut"
maxElementsInMemory="5"
eternal="false"
timeToIdleSeconds="20"
timeToLiveSeconds="20"
overflowToDisk="false"
diskPersistent="false"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
我该如何访问EhCache的默认缓存?
CacheManager.getInstance().getCache("default"); // returns null
而 defaultCache 元素没有 name 属性 - _ehcache.xsd_。
顺便说一下,
CacheManager.getInstance().addCache("default")
抛出 "The Default Cache has already been configured"。 - cubanacan