一缕清风007
2015-12-23 07:53shiro整合ehcache时报错
5shiro整合ehcache
application-shiro.xml中相关配置:
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="userRealm" />
<!-- 注入缓存管理器 -->
<property name="cacheManager" ref="cacheManager"/>
<!-- 注入session管理器 -->
<property name="sessionManager" ref="sessionManager" />
</bean>
<!-- 缓存管理器 -->
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManagerConfigFile" value="classpath:pvf-shiro-ehcache.xml"/>
</bean>
pvf-shiro-ehcache.xml
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false">
<!--diskStore:缓存数据持久化的目录 地址 -->
<diskStore path="java.io.tmpdir"/>
<defaultCache
maxElementsInMemory="1000"
maxElementsOnDisk="10000000"
eternal="false"
overflowToDisk="false"
diskPersistent="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU">
</defaultCache>
</ehcache>
项目启动时报错:
Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.apache.shiro.cache.ehcache.EhCacheManager] to required type [net.sf.ehcache.CacheManager] for property 'cacheManager': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
... 53 more
- 点赞
- 回答
- 收藏
- 复制链接分享
4条回答
为你推荐
- spring+ boot+ shiro+ jwt怎么监听用户是否在线
- java
- intellij-idea
- 2个回答
- spring Redis,shiro,redis用工具可以连接上。登陆系统时报错
- spring
- java
- eclipse
- 3个回答
- shiro如何保存用户相关的信息,以及整合redis的作用
- spring
- java
- java-ee
- 1个回答
- 关于Shiro的在线用户获取问题
- shiro
- 0个回答
- springmvc和shiro整合时出错
- spring
- shiro
- 7个回答
换一换