No cache or cacheManager properties have been set. Authorization cache cannot be obtained.

来源:互联网 发布:smg淘宝店 编辑:程序博客网 时间:2024/06/06 12:52

参考:点击打开链接


问题:使用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>



1 0
原创粉丝点击