Singleton ehcache CacheManager warning fix

If you experience the following warning in your hibernate+ehcache application:

2008-11-20 13:02:42,937 WARN  ( - 
  Creating a new instance of CacheManager using the diskStorePath 
  "D:\apache-tomcat-5.5.26\temp" which is already used by an 
  existing CacheManager.
The source of the configuration was classpath.
The diskStore path for this CacheManager will be set to 
To avoid this warning consider using the CacheManager factory 
  methods to create a singleton CacheManager or specifying a 
  separate ehcache configuration (ehcache.xml) for each 
  CacheManager instance.

then you need to set the following in your hibernate.cfg.xml file:

<property name="hibernate.cache.provider_class">

Ehcache Hibernate documentation

6 Responses to “Singleton ehcache CacheManager warning fix”

  1. Renny Says:

    THANK YOU!!!!

  2. ioannis cherouvim » Blog Archive » Singleton ehcache CacheManager warning fix « Martin Schaaf’s Blog Says:

    [...] ioannis cherouvim » Blog Archive » Singleton ehcache CacheManager warning fix 2010 January 26 tags: detectAndFixDiskStorePathConflict, ehcache, hibernate, Programming by mascha ioannis cherouvim » Blog Archive » Singleton ehcache CacheManager warning fix. [...]

  3. Articles » Spring + JPA + Hibernate + Tomcat + EHCache Says:

    [...] I was getting a WARN message if I used org.hibernate.cache.EhCacheProvider. I referred to this post for a [...]

  4. cometta Says:

    you also need to add this line


    in your applicationcontext.xml

  5. jaime Says:

    In hibernate 3.6.1 you need this in persistence.xml (if using jpa)

    for ehcache 2.2.0

  6. jaime Says:

    property name=”hibernate.cache.region.factory_class” value=”net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory”