I have the ehcache working in the following conditions:
1. Using only hibernate criteria api with list() method and setCachable(true)
2. ehcache.xml contains default cache only and is located in the classpath root:
Code:
<defaultCache
maxElementsInMemory="10000"
eternal="true"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
diskSpoolBufferSizeMB="30"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="FIFO"
statistics="false"
/>