Closed GoogleCodeExporter closed 9 years ago
Original comment by eric.dalquist
on 7 Jul 2010 at 1:46
I am able to replicate the problem you report by creating the following
(incorrect) beans in a Spring applicationContext:
{{{
<ehcache:annotation-driven cache-manager="ehCacheManager"
create-missing-caches="true"/>
<ehcache:config>
<ehcache:evict-expired-elements interval="20"/>
</ehcache:config>
<bean id="cacheManager" class="java.lang.String">
<constructor-arg><value>I am not a cacheManager.</value></constructor-arg>
</bean>
<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
</bean>
}}}
This fails because the ehcache:config element is missing the cache-manager
attribute.
Simply change the ehcache:config element in your config to include it, like so:
{{{
<ehcache:annotation-driven cache-manager="ehCacheManager"
create-missing-caches="true"/>
<ehcache:config cache-manager="ehCacheManager">
<ehcache:evict-expired-elements interval="20"/>
</ehcache:config>
}}}
Original comment by nicholas.blair
on 7 Jul 2010 at 5:00
I have updated the wiki page for EvictExpiredElements to reflect the need to
specify the cache-manager attribute for the config element in the same fashion
as the annotation-driven element.
Original comment by nicholas.blair
on 7 Jul 2010 at 5:09
I'm marking this resolved since there hasn't been further comment and it
appears to have been a problem in the documentation which has since been fixed.
Original comment by eric.dalquist
on 9 Jul 2010 at 12:48
Original issue reported on code.google.com by
timmy.st...@gmail.com
on 7 Jul 2010 at 8:13