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. 健壮的 Java 基准测试

    健壮的 Java 基准测试 健壮的 Java 基准测试,第 1 部分: 问题 了解 Java 代码基准测试的问题 Brent Boyer, 程序员, Elliptic Group, Inc. 简介:程 ...

  2. [JZOJ3171] 【GDOI2013模拟4】重心

    题目 描述 题目大意 有一堆长为222的矩形,最下面的右端点横坐标为000. 每个矩形都有其固定的质量. 将这些矩形堆在一起,使得最右边的横坐标最大,并且满足它不会塌掉(满足物理学). 思考历程 首先 ...

  3. csp-s模拟测试56Merchant, Equation,Rectangle题解

    题面:https://www.cnblogs.com/Juve/articles/11619002.html merchant: 二分答案,贪心选前m大的 但是用sort复杂度不优,会T掉 我们只是找 ...

  4. Ionic3 demo TallyBook 实例3

    1.准备应用相关组件 echarts--直接 npm install 安装即可 2.home.ts import { Component,ViewChild,ElementRef } from '@a ...

  5. 平衡树模板【splay的实现】

    [平衡树splay实现] 无注释代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; ,MAXN=1e ...

  6. linux ssh密钥认证, 免密码登陆

    1. 客户端生成密钥 # mkdir ~/.ssh # chmod ~/.ssh # cd ~/.ssh 生成RSA密钥 # ssh-keygen -t rsa (然后连续三次回车) 2. 把公钥传到 ...

  7. Mysql千万级数据性能调优配置

    背景: 笔者的源数据一张表大概7000多万条,数据大小36G,索引6G,加起来表空间有40G+,类似的表有4张,总计2亿多条 数据库mysql,引擎为innodb,版本5.7,服务器内存256G,物理 ...

  8. sql server2008安装时提示重启计算机失败怎么办

    安装SQL Server 2008时,经常会遇到这样一个问题,软件提示“重启计算机失败”,如果忽略的话,会给后面的安装带来很大的麻烦,这里如何解决呢?   工具/原料 注册表 解决方法   在键盘上按 ...

  9. [转]WPF 构建无外观(Lookless)控件

    构建一个用户可以使用Template属性设置外观的WPF控件需要以下几步 1.继承自System.Windows.Controls.Control 2.设置DefaultStyleKeyPropert ...

  10. 移动端video视频播放问题

    1.视频播放后自动全屏 video添加playsinline  webkit-playsinline属性 2.安卓暂停或播放完毕不能滑动 通过js判断机型,安卓去掉controls属性,ios保留co ...