参考:点击打开链接
问题:使用Shiro授权时控制台在取得权限的时候老是打印出:org.apache.shiro.realm.AuthorizingRealm:248 - No cache or cacheManager properties have been set. Authorization cache cannot be obtained.
原因是:没有配置权限缓存,但是在不配置权限缓存时需要怎么解决呢?
解决方法:关闭授权缓存域,把authorizationCachingEnabled设置为false。
<bean id="roleBaseAuthorizingRealm" class="com.company.web.RoleBaseAuthorizingRealm">
<property name="adminService" ref="adminService"/>
<property name="authorizationCachingEnabled" value="false"/>
</bean>