码迷,mamicode.com
首页 > 编程语言 > 详细

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.

时间:2017-07-22 19:40:10      阅读:505      评论:0      收藏:0      [点我收藏+]

标签:factory   manage   lease   单例   methods   versions   creating   解释   with   

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 [stream=java.io.BufferedInputStream@1b4ca1]

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

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

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

 

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.

标签:factory   manage   lease   单例   methods   versions   creating   解释   with   

原文地址:http://www.cnblogs.com/blogjava-blogs/p/7222146.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!