这是我运行junit测试时会发生的事情......
Another CacheManager with same name '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:
DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]
Run Code Online (Sandbox Code Playgroud)
异常背后的原因是什么?可以同时运行多个cacheManager吗?
这就是我使用Sping 3.1.1配置cachManager的方法.它将cacheManager的范围明确设置为"singleton"
<ehcache:annotation-driven />
<bean …Run Code Online (Sandbox Code Playgroud)