您的位置:首页 > 其它

Another unnamed CacheManager already exists in the same VM

2016-08-25 10:45 846 查看
Your EhCacheManagerFactoryBean may be a singleton, but it's building multiple CacheManagers and trying to give them the same name. That violates Ehcache 2.5semantics.Versions of Ehcache before version 2.5 allowed any number of CacheManagers with the same name (same configuration resource) to exist in a JVM.Ehcache 2.5 and higher does not allow multiple CacheManagers with the same name to exist in the same JVM. CacheManager() constructors creating non-Singleton CacheManagers can violate this ruleTell the factory bean to created a shared instance of the CacheManager in the JVM by setting theshared property to true.
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
p:shared="true"/>
p:xxx  是在xml的header里面define的,  for schema的namespace. 意思是设置该bean的property属性。
p:share="true"等同<property name="share" value="true" />。
最后设置了<property name="shared" value="true"/>,  但是后面启动服务后会自动报出updateCheck的问题,设置ehcache.xml如下,即可解决
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐