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>