Announcement Announcement Module
No announcement yet.
Facing issue with ehcache while configuring in spring context. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facing issue with ehcache while configuring in spring context.

    I am using Spring 3.0.6 in my project in which i am trying to configure the annotation based ehcache. Below are the beans i have defined for cacheManager and cache in my spring context. When i test this configuration i am not getting the cache under the cacheManger. The requirement is to provide the cache initializing parameters through a property file thats why i am not using external ehcache.xml for cache configuration. I am not sure if i am missing any particular configuration to make it working, as per the API it should add the cache to the cacheManager but while debugging i didn't find any cache in the cacheManager. Please suggest. Many thanks in advance!
    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" name="cacheManager">
        <property name="configLocation"  value="test-wpsEhcache.xml"/>
    <bean id="dictionaryItemCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
        <property name="cacheManager"  ref="cacheManager"/>
        <property name="cacheName"  value="dictionaryItemCache"/>
        <property name="maxElementsInMemory" value="${ehcache.dictionaryItem.maxElementsInMemory}" />
        <property name="timeToLive" value="${ehcache.dictionaryItem.timeToLiveSeconds}" />
        <property name="overflowToDisk" value="false" />
        <property name="diskPersistent" value="false" />
        <property name="memoryStoreEvictionPolicy" value="LRU" />
    maven dependecy inserted in pom