title: Spring 3.1 @Cacheable with ehcache doesn't work
body: <p>My @Cacheable with Spring and ehcache doesn't work, no datas are put on the cache.
  When the application calls the cacheable method getFolProfile, the database is always call rather than the cache.
  Can you, please, say me what is wrong in my code.</p>
  
  <p>My root-context.xml:</p>
  
  <pre><code>    &lt;cache:annotation-driven proxy-target-class="true"/&gt;   
      &lt;bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:configLocation="classpath:/cache/ehcache.xml"  /&gt; 
      &lt;bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cacheManager-ref="ehcache"/&gt;
  </code></pre>
  
  <p>My Service :</p>
  
  <pre><code>    import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.cache.annotation.Cacheable;
      import org.springframework.stereotype.Service;
  
      @Service
      public class FolManager {
  @Autowired
  FolDao folDao;
  
  
  
  @Cacheable(value = "oneCache", key = "#email")
  public FolProfileForm getFolProfile(String email) {
      return folDao.retrieveByLogin(email);
  }
      }
  </code></pre>
  
  <p>My ehcache.xml: </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd"&gt;
      &lt;diskStore path="c:/tmp" /&gt;
      &lt;defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120"
      timeToLiveSeconds="120" overflowToDisk="true" diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000"
      diskPersistent="false" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU" /&gt;
      &lt;cache name="oneCache" maxElementsInMemory="100000" maxElementsOnDisk="10000000" eternal="true" diskPersistent="true"
      overflowToDisk="true" diskSpoolBufferSizeMB="20" memoryStoreEvictionPolicy="LFU" /&gt;
      &lt;/ehcache&gt;
  </code></pre>
  
  <p>Thanks for your help
  Michel</p>