由于之前通过在shiro中集成 Ehcache 实现 对session 进行缓存,但是在今天在使用Ehcache 集成 spring cache 中遇到了一个问题,出现以下异常信息:
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:|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=sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@62319d96]
at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:631)
at net.sf.ehcache.CacheManager.init(CacheManager.java:395)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:355)
at org.apache.shiro.cache.ehcache.EhCacheManager.ensureCacheManager(EhCacheManager.java:213)
at