title: Can't get Ehcache to work with spring 3
body: <p>I am new to Spring so please forgive me if my question is foolish...</p>
  
  <p>I am trying to follow some examples for configuring security on a spring web application. I have configured it to work with ldap directory. Now I need to add caching to the process so that the credentials are not fetched from the ldap directory every time they are requested.</p>
  
  <p>For this I have added <code>cache-ref="userCache"</code> as shown in the tutorial: </p>
  
  <pre><code>&lt;authentication-manager&gt;
     &lt;authentication-provider&gt;
       ...
      &lt;ldap-user-service server-ref="ldapServer"
         user-search-filter="uid={0}" user-search-base="ou=people"
         group-search-filter="member={0}" group-search-base="ou=groups"
         cache-ref="userCache" /&gt;
     &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>The bean <code>userCache</code> is defined like this : </p>
  
  <pre><code> &lt;beans:bean id="userCache"             
      class="org.springframework.security.providers.
      dao.cache.EhCacheBasedUserCache"&gt;
      &lt;beans:property name="cache" ref="userEhCache" /&gt;
   &lt;/beans:bean&gt;
   &lt;beans:bean id="userEhCache"
       class="org.springframework.cache.ehcache.EhCacheFactoryBean"&gt;
       &lt;beans:property name="cacheManager" ref="cacheManager" /&gt;
       &lt;beans:property name="cacheName" value="userCache" /&gt;
   &lt;/beans:bean&gt;
  </code></pre>
  
  <p>The cache manager is defined as follows: </p>
  
  <pre><code>  &lt;bean id="cacheManager"
     class="org.springframework.security.core.userdetails.cache.EhCacheManagerFactoryBean" /&gt;
  </code></pre>
  
  <p>The problem with this configuration is that I couldn't get the jars because they are based on an old version of spring 2.  The cache manager I got it using </p>
  
  <pre><code> &lt;bean id="cacheManager"
   class="net.sf.ehcache.CacheManager" /&gt;
  </code></pre>
  
  <p>but the <code>org.springframework.cache.ehcache.EhCacheFactoryBean</code>  and <code>org.springframework.security.providers.dao.cache.EhCacheBasedUserCache</code> I don't know where to get them beside from spring 2 which if I add to my project it brakes everything. </p>
  
  <p>I would appreciate any help in this matter. If you have some other solution please make some suggestions. Thanks!</p>