项目中用spring shiro来处理权限的问题,可是启动的时候会打印以下日志spring
org.apache.shiro.realm.AuthorizingRealm - No cache or cacheManager properties have been set. Authorization cache cannot be obtained.
检查了basicRelam配置以下apache
<bean id="basicRealm" class="com.ebon.platform.realm.BasicRealm" />
BasicRealm继承自AuthorizingRealmspa
根据提示信息能够判断未给BasicRealm指定cacheManager,因此修改以下日志
<bean id="basicRealm" class="com.ebon.platform.realm.BasicRealm" > <property name="authorizationCacheName" value="shiro-authorizationCache"/> <property name="cacheManager" ref="shiroCacheManager"/> </bean>