CacheManager Loading problems

Source: Internet
Author: User

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 there is no beanid, can not be injected to get chachemanager, with ehcache.xml into the SRC root folder, you can actively create the cache,
Assuming that you are in a free folder, you can create a cache by adding listener to the file creation Cachemanage under Web. xml


For example, the following configuration shiro the cache with ehcachecachemanager, because the system can only create a ehcachecachemanager

so make your own and system creation way from the same place. Even if used under the Classpath path through the Ehcache.xml configuration.

Then let yourself and the system point to it can be, 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>

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center ">

CacheManager Loading problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.