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

时间:2023-03-09 16:36:34
No cache or cacheManager properties have been set.  Authorization cache cannot be obtained.
20235 [http-bio-8080-exec-10] INFO  o.a.shiro.realm.AuthorizingRealm - No cache or cacheManager properties have been set.  Authorization cache cannot be obtained. 

原因是:自定义的Realm文件在继承AuthorizingRealm 时,没有设置cache或者cacheManager属性

解决办法有两种:

1.是关闭cache

    <bean id="dbRealm" class="cn.zno.smse.common.security.DataBaseRealm">
<property name="cachingEnabled" value="true"></property>
<property name="authenticationCachingEnabled" value="false"></property>
</bean>

2.是设置cache或者cacheManager

必须是实现了 org.apache.shiro.cache.CacheManager 接口的类