shiro与spring集成时报Versions of Ehcache before version 2.5 allowed any number of CacheManagers with the same name (same configuration resource) to exist in a JVM.

shiro与spring集成时,一直报Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: InputStreamConfigurationSource [[email protected]]

解决方法:把ehcache的jar包改成2.5前的,原因是2.5后CacheManager使用了单例.

顺便吐槽一下,现在百度一下问题,千篇一律的答案,全是复制别人的,没解释不说还不注明出处.

有需要的可以去看下那位博主所说的原因,地址为:http://blog.csdn.net/u013147600/article/details/48133913

时间: 2024-08-06 10:04:07

shiro与spring集成时报Versions of Ehcache before version 2.5 allowed any number of CacheManagers with the same name (same configuration resource) to exist in a JVM.的相关文章

Shiro与Spring集成

1.新建web工程,加入 Spring 和 Shiro 的 jar 包 2.配置web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta

Java 权限框架 Shiro 实战二:与spring集成、filter机制

Shiro和Spring的集成,涉及到很多相关的配置,涉及到shiro的filer机制以及它拥有的各种默认filter,涉及到shiro的权限判断标签,权限注解,涉及到session管理等等方面. 1. 配置 首先需要在web.xml中专门负责接入shiro的filter: <!-- shiro 安全过滤器 --> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.

Apache Shiro学习笔记(九)Spring集成

鲁春利的工作笔记,好记性不如烂笔头 Integrating Apache Shiro into Spring-based Applications Shiro 的组件都是JavaBean/POJO 式的组件,所以非常容易使用Spring进行组件管理,可以非常方便的从ini配置迁移到Spring进行管理,且支持JavaSE应用及Web 应用的集成. Web Applications 1.web.xml <!-- The filter-name matches name of a 'shiroFil

spring集成ehcache本地缓存

1.maven依赖 <!-- ehcache 相关依赖 --> <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>2.8.2</version> </dependency> ehcache 2.配置ecache.xml配置 <ehcache xmlns:xsi=&qu

shiro实战系列(十五)之Spring集成Shiro

Shiro 的 JavaBean 兼容性使得它非常适合通过 Spring XML 或其他基于 Spring 的配置机制.Shiro 应用程序需要一个具 有单例 SecurityManager 实例的应用程序.请注意,这不会是一个静态的单例,但应该只有一个应用程序能够使用 的实例,无论它是否是静态单例的. Web Applications Shiro 拥有对 Spring Web 应用程序的一流支持.在 Web 应用程序中,所有 Shiro 可访问的万恶不请求必须通过一个 主要的 Shiro 过滤

【Shiro】Apache Shiro架构之集成web

前面两节内容介绍了Shiro中是如何进行身份和权限的认证,但是只是单纯的进行Shiro的验证,简单一点的话,用的是.ini配置文件,也举了个使用jdbc realm的例子,这篇博文主要来总结一下Shiro是如何集成web的,即如何用在web工程中. 写在前面:本文没有使用web框架,比如springmvc或者struts2,用的是原始的servlet,使用的是.ini配置文件,旨在简单粗暴,说明问题.后面会写一些和框架整合的博文. 本文部分参考Apache Shiro的官方文档,文档地址:htt

使用Shiro 集合Spring来实现权限控制

这只是笔记 web.xml中引入 spring-shiro.xml spring-shiro.xml : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x

spring集成mqtt客户端相关逻辑分析

概述 mqtt客户端有很多java实现,官网上列出了下面这些: Eclipse Paho Java Xenqtt Includes a client library, mock broker for unit/integration testing, and applications to support enterprise needs like using a cluster of servers as a single client, an HTTP gateway, etc. MeQan

Spring 集成Redis哨兵模式

Spring 集成Redis哨兵模式 1.pom文件添加以下jar <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> <version>1.7.2.RELEASE</version> </dependency> <!-- redis客户端jar -->