Note that there are some explanatory texts on larger screens.

plurals
  1. POAnother unnamed CacheManager already exists in the same VM (ehCache 2.5)
    primarykey
    data
    text
    <p>This is what happens when I run my junit tests...</p> <pre><code>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 ] </code></pre> <p>What's the reason behind the exception. Could there be more than 1 cacheManager running simultaneously?</p> <p>This is how I configured the cachManager using Sping 3.1.1. It sets explicitly the scope of the cacheManager to "singleton"</p> <pre><code>&lt;ehcache:annotation-driven /&gt; &lt;bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" scope="singleton" /&gt; </code></pre> <p>The ehcache.xml looks like</p> <pre><code>&lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false" maxBytesLocalHeap="100M" name="cacheManager" &gt; .... &lt;/ehcache&gt; </code></pre> <p>Finally my class </p> <pre><code>@Component public class BookingCache implements CacheWrapper&lt;String, BookingUIBean&gt; { @Autowired private CacheManager ehCacheManager; .... } </code></pre> <p>I'm very sure that I'm dealing with only one cacheManager in my code base. Something else is probably running the n-th instance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload