Resolve Spring+shiro CacheManager Login Error

Source: Internet
Author: User

First, project start, login error
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Shirofilter ' defined in class PA TH resource [Spring-mvc.xml]: Cannot resolve reference to beans ' securitymanager ' while setting bean property ' Securitymana Ger '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' SecurityManager ' defined in class path resource [Spring-mvc.xml]: Cannot resolve reference-bean ' sessionmanager ' while Setting bean property ' SessionManager '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' SessionManager ' defined in class path resource [Spring-mvc.xml]: Cannot resolve reference-bean ' ecachemanager ' while SE Tting Bean property ' CacheManager '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Ecachemanager ' defined in class path resource [Spring-mvc.xml]: Initialization of Bean failed; Nested EXCEPtion is org.springframework.beans.FatalBeanException:Error initializing bean [Ecachemanager]; Nested exception is org.apache.shiro.cache.CacheException: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:
1. Use one of the cachemanager.create () static factory methods to reuse same CacheManager with same name or create one if Necessary
2. Shutdown the earlier CacheManager before creating new one with same name.

Second, the solution:
<ehcache.version>2.4.8</ehcache.version>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>${ehcache.version}</version>
</dependency>

Resolve Spring+shiro CacheManager Login Error

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.