Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Shirofilter ' defined in class Path resource [Spring/spring-shiro-web.xml]: Cannot resolve reference to beans ' securitymanager ' while setting bean Propert Y ' SecurityManager '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' SecurityManager ' defined in class path resource [Spring/spring-shiro-web.xml]: Cannot resolve reference to bean ' Userrealm ' While setting beans property ' realm '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Userrealm ' Defined in class path resource [Spring/spring-shiro-web.xml]: Cannot resolve reference-bean ' credentialsmatcher ' while Setting bean property ' Credentialsmatcher '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Credentialsmatcher ' defined in class path resource [spring/spring-shiro-web.xML]: Cannot resolve reference to beans ' shirocachemanager ' while setting constructor argument; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Shirocachemanager ' defined in class path resource [Spring/spring-shiro-web.xml]: Cannot resolve reference to bean ' EhCache Manager ' while setting beans property ' CacheManager '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Ehcachemanager ' defined in class path resource [Spring/spring-shiro-web.xml]: Invocatio N of Init method failed; Nested exception is 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:
Finally red is the key, saying to make sure that the cache manager can only have one!
After shiro1.3, make sure that the cache manager is singleton.
So it needs to be fitted
<!--mybatis using Ehcache cache start--><bean id= "Ehcachemanager" class= " Org.springframework.cache.ehcache.EhCacheManagerFactoryBean "><property name=" configlocation "value=" Classpath:ehcache/shiroehcache.xml "/> <property name=" shared "value=" true "></property> <!-- Here is the key!!! There is no need to be wrong --></bean><!--end MyBatis use Ehcache cache--><!--Cache manager Ehcache Implementation--><bean id= " Shirocachemanager "class=" Org.apache.shiro.cache.ehcache.EhCacheManager "><property name=" CacheManager "ref= "Ehcachemanager"/></bean>
Full Configuration Document Address
http://download.csdn.net/detail/tragedyxd/9026633
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
SPRINGMVC + Mybatis + Shiro + Ehcache when the cache manager error.