title: Spring EhCache configuration - Cannot find class [org.springframework.cache.ehcache.EhCacheManagerFactoryBean]
body: <p>I need help with ehCache configuration. 
  These what i did :</p>
  
  <p><strong>ehcache.xml</strong>  inside my src/main/resources folder</p>
  
  <pre><code>&lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="ehcache.xsd"
  updateCheck="true"
  monitoring="autodetect"
  dynamicConfig="true"&gt;
  
  &lt;diskStore path="java.io.tmpdir" /&gt;
  
  &lt;cache name="allNodesCache"
      maxEntriesLocalHeap="10000"
      maxEntriesLocalDisk="1000"
      eternal="false"
      diskSpoolBufferSizeMB="20"
      timeToIdleSeconds="300" timeToLiveSeconds="600"
      memoryStoreEvictionPolicy="LFU"
      transactionalMode="off"&gt;
      &lt;persistence strategy="localTempSwap" /&gt;
  &lt;/cache&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>ehCache configuration inside my applicationContext-web.xml</strong> </p>
  
  <pre><code>&lt;!--  ehCache configuration --&gt;
  &lt;cache:annotation-driven /&gt;
  &lt;bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache"/&gt;
  &lt;!-- EhCache library setup --&gt;
  &lt;bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="ehcache.xml"/&gt;
  </code></pre>
  
  <p><strong>pom.xml:</strong></p>
  
  <pre><code>&lt;!--  ehCache --&gt;
      &lt;dependency&gt;
         &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
         &lt;artifactId&gt;ehcache&lt;/artifactId&gt;
         &lt;version&gt;2.7.2&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p><strong>My repository class:</strong></p>
  
  <pre><code>@Repository
  </code></pre>
  
  <p>public interface NodeRepository extends JpaRepository {</p>
  
  <pre><code>@Cacheable(value = "allNodesCache", key = "#node")
  @Query("select new com.datum.fnd.domain.Node(c.idNode, c.name, c.address, c.description, c.point) from Node c")
  </code></pre>
  
  <p><strong>I got message like this :</strong>
     Cannot find class [org.springframework.cache.ehcache.EhCacheManagerFactoryBean] for bean with name 'ehcache' defined in ServletContext resource [/WEB-INF/spring/applicationContext-web.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean</p>