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">
相关文章推荐
- Another unnamed CacheManager already exists in the same VM
- Another unnamed CacheManager already exists in the same VM.解决方法
- Another unnamed CacheManager already exists in the same VM (ehCache 2.5) 解决办法
- 在整合springmvc+mybatis+ecache时候报错如下: Another unnamed CacheManager already exists in the same VM.
- Another unnamed CacheManager already exists in the same VM
- Another unnamed CacheManager already exists in the same VM.解决方法
- hibernate3与ehcache-2.8.3配合使用,在多个SessionFactory实例的情况下出现“Another unnamed CacheManager already exists in the same VM”问题
- Ehcache配置时出错- Another unnamed CacheManager already exists in the same VM. Please provide unique name
- SpringBoot--P-1:缓存 Another unnamed CacheManager already exists in the same VM.
- net.sf.ehcache.CacheException: Another unnamedCacheManager already exists in the same VM
- Hibernate 异常CacheException: Another unnamed CacheManager already exists in the same VM
- net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM.
- Ehcache依赖版本问题:Another CacheManager with same name 'es' already exists in the same VM.
- Excel导入遇到的问题An object with the same key already exists in the ObjectStateManager……
- Socket file /var/lib/mysql/mysql.sock exists. Is another MySQL daemon already running with the same
- Socket file /tmp/mysql.sock exists. Is another MySQL daemon already running with the same unix socke
- Another MySQL daemon already running with the same unix socket.
- Another MySQL daemon already running with the same unix socket
- eclipse android : A project with that name already exists in the workspace
- 报表工具FineReport报错:java.sql.SQLException: The database is already in use by another process: lockFile