-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Vincent PERICART opened SPR-11080 and commented
A blocking cache defined like this:
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="classpath:ehcache.xml" />
<property name="shared" value="false" />
</bean>
<bean id="abstractBlockingCacheFactory" class="org.springframework.cache.ehcache.EhCacheFactoryBean" abstract="true">
<property name="cacheManager" ref="ehcache" />
<property name="blocking" value="true" />
<property name="statisticsEnabled" value="true" />
<property name="timeToLive" value="1800" />
</bean>
<bean id="jspCacheFactory" parent="abstractBlockingCacheFactory" />
Used to work in 3.2.4.RELEASE but fails in 3.2.5.RELEASE with the message :
The jspCacheFactory Cache is not alive (STATUS_UNINITIALISED)
ehcache version is 2.6.6
The error is thrown in ehCacheFactoryBean:342 because setStatisticsEnabled requires the cache to be alive.
The solution would be to enable statistics after initialization (after doing this.cacheManager.addCache(rawCache); )
Affects: 3.2.5
Issue Links:
- Set statistics enabled for EhCache [SPR-11092] #15718 Set statistics enabled for EhCache ("is duplicated by")