Net.sf.ehcache.CacheException:Another unnamed CacheManager already exists in the same VM. Provide unique names for each cachemanager in the config or do one of the following:
The system will create CacheManager, but no beanid, cannot be injected to get chachemanager, with ehcache.xml into the src root directory, you can automatically create the cache,
If you are in any directory, you can add listener under Web. XML to create a cachemanage with the file creation cache
use Shiro ehcachecachemanager, because the system can only create a ehcachecachemanager
so you want to create your own and system from the same place, even if you use the Classpath path through the Ehcache.xml configuration,
Then let yourself and the system point to it, the file name must be Ehcache.xml
<bean id= "Ehcachemanager"
class= "Org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
<property name= "configlocation" value= "Classpath:/ehcache.xml"/>
<property name= "Shared" value= "true"/>
</bean>
<bean id= "CacheManager" class= "Org.springframework.cache.ehcache.EhCacheCacheManager" >
<property name= "CacheManager" ref= "Ehcachemanager"/>
</bean>
<bean id= "Shirocachemanager" class= "Org.apache.shiro.cache.ehcache.EhCacheManager" >
<property name= "CacheManager" ref= "Ehcachemanager"/>
</bean>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
CacheManager Loading issues