org.apache.shiro.realm.AuthorizingRealm - No cache or cacheManager properties have been set. Authorization cache cannot be obtained.

项目中用spring shiro来处理权限的问题,但是启动的时候会打印如下日志

org.apache.shiro.realm.AuthorizingRealm  - No cache or cacheManager properties have been set.  Authorization cache cannot be obtained.

检查了basicRelam配置如下

<bean id="basicRealm" class="com.ebon.platform.realm.BasicRealm" />

BasicRealm继承自AuthorizingRealm

根据提示信息可以判断未给BasicRealm指定cacheManager,所以修改如下

<bean id="basicRealm" class="com.ebon.platform.realm.BasicRealm" >
        <property name="authorizationCacheName" value="shiro-authorizationCache"/>
        <property name="cacheManager" ref="shiroCacheManager"/>
</bean>

 

posted on 2015-02-27 10:02  modprobe  阅读(6539)  评论(0编辑  收藏  举报