org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve reference to bean 'userRealm' while setting bean property
'realm'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRealm' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve reference to bean 'credentialsMatcher' while setting
bean property 'credentialsMatcher'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'credentialsMatcher' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve reference to bean
'shiroCacheManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroCacheManager' defined in class path resource [spring/spring-shiro-web.xml]: Cannot resolve
reference to bean 'ehCacheManager' while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'ehCacheManager' defined in class path resource [spring/spring-shiro-web.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: Another unnamed CacheManager already
exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:

最后红色是关键,说要确保缓存管理器仅仅能有一个!

在shiro1.3以后,要确保缓存管理器是单例的。

所以须要这样配

	<!-- MyBatis使用ehcache缓存 start -->
<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:ehcache/shiroEhcache.xml" />
<property name="shared" value="true"></property> <!-- 这里是关键。!。没有必错 -->
</bean>
<!-- end MyBatis使用ehcache缓存 -->
<!-- 缓存管理器 使用Ehcache实现 -->
<bean id="shiroCacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="ehCacheManager" />
</bean>

完整配置文档地址

http://download.csdn.net/detail/tragedyxd/9026633

SpringMVC + Mybatis + Shiro + ehcache时缓存管理器报错。的更多相关文章

  1. npm包管理器报错-npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@XXX(over 30000ms)

    由于这两天买的新电脑在短期内频频蓝屏.卡机,不得不把自己其他的本本拿出来换上,但是程序员换电脑是真的痛苦,其他不说就说一个配环境 真的折腾哈 我是一名前端菜鸟,现在自己的本本上使用的是npm包管理工具 ...

  2. ie11的DOM管理器报错

    IE11 Windows7下F12 DOC资源管理器不能用Exception in window.onload: Error: An error has ocurredJSPlugin.3005--- ...

  3. SpringMVC+mybatis+maven+Ehcache缓存实现

    所谓缓存,就是将程序或系统经常要调用的对象存在内存中,以便其使用时可以快速调用,不必再去创建新的重复的实例.这样做可以减少系统开销,提高系统效率. 缓存主要可分为二大类: 一.通过文件缓存,顾名思义文 ...

  4. shiro与Web项目整合-Spring+SpringMVC+Mybatis+Shiro(八)

    Jar包

  5. SpringMVC+MyBatis+Shiro 配置文件详解

    1.web.xml文件的配置 <?xml version="1.0" encoding="UTF-8"?> <web-app version= ...

  6. SpringMVC Mybatis Shiro RestTemplate的实现客户端无状态验证及访问控制【转】

    A.首先需要搭建SpringMVC+Shiro环境 a1.pom.xml配置 spring: <dependency> <groupId>org.springframework ...

  7. SpringMVC+Mybatis+MySQL配置Redis缓存

    SpringMVC+Mybatis+MySQL配置Redis缓存 1.准备环境: SpringMVC:spring-framework-4.3.5.RELEASE-dist Mybatis:3.4.2 ...

  8. 自定义缓存管理器 或者 Spring -- cache

    Spring Cache 缓存是实际工作中非常常用的一种提高性能的方法, 我们会在许多场景下来使用缓存. 本文通过一个简单的例子进行展开,通过对比我们原来的自定义缓存和 spring 的基于注释的 c ...

  9. spring+springMVC+Mybatis 中使用@Transcational方式管理事务的配置方法

    springMVC 中,事务通常都在service层控制,当然controller层也可以用事务,只要配置配对,但通常不建议直接在controller层配事务,controller的作用是管理参数以及 ...

随机推荐

  1. 数据类中引用virtual

    public class City { [Key] public int CityID { set; get; } [Display(Name = "城市名称")] [Requir ...

  2. 《代码整洁之道》ch5~ch9读书笔记 PB16110698(~3.15) 第二周

    <代码整洁之道>ch5~ch9读书笔记 本周我阅读了本书的第5~9章节,进一步了解整洁代码需要注意的几个方面:格式.对象与数据结构.错误处理.边界测试.单元测试和类的规范.以下我将分别记录 ...

  3. [NOIP2019模拟赛]HC1147 时空阵

    题目描述: 幽香这几天学习了魔法,准备建造一个大型的时空传送阵. 幽香现在可以在幻想乡的n个地点建造一些传送门,如果她建造了从地点a与地点b之间的传送门,那么从a到b和从b到a都只需要单位1的时间. ...

  4. leetcode-86-分割链表

    题目描述: 方法一: # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.va ...

  5. 关于公式文件.eqn

    建议默认打开该选项

  6. 箭头函数报错:Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.

    解决:根目录新建babel.config.js加入如下内容 module.exports = { presets: [ "@babel/preset-env", "@ba ...

  7. canvas石英钟

    canvas石英钟:demo <!DOCTYPE html> <html> <head lang="en"> <meta charset= ...

  8. VUX的使用方法(以弹出框为例)

    一.安装 cnpm install vux --save cnpm install vux-loader --save-dev 二.配置 const vuxLoader = require('vux- ...

  9. PAT甲级——A1101 Quick Sort

    There is a classical process named partition in the famous quick sort algorithm. In this process we ...

  10. Python学习day44-数据库(单表及多表查询)

    figure:last-child { margin-bottom: 0.5rem; } #write ol, #write ul { position: relative; } img { max- ...