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>

 

文章来自:http://www.cnblogs.com/modprobe/p/4302675.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3