I'm running into a problem where I'm defining a cache through my XML configuration and the enabling of statistics is failing.
I have a cache manager defined thusly
And I then define the cache using this:
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="/WEB-INF/ehcache.xml" />
In my ehcache.xml, I have the defaultCache configured as .
<bean id="dataServiceCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager" ref="ehcache" />
<property name="cacheName" value="dataService" />
<property name="memoryStoreEvictionPolicy" value="LRU" />
<property name="maxElementsInMemory" value="100" />
<property name="statisticsEnabled" value="true" />
However when I start the container, I get an illegal state exception indicating that the cache is STATUS_UNINITIALIZED. Using 3.1.1.RELEASE, this happens at EhCacheFactoryBean.createCache() line 365,
which sets the statisticsEnabled property on the cache.
At this point in the creation of the cache bean, the cache has not yet been registered with the cache manager and as such this property can not be set.
Has anyone else encountered this issue? How much would be involved with getting this fixed?
I can supply a patch indicating what i think /should/ be happening instead of the current operation.