Singleton ehcache CacheManager warning fix
If you experience the following warning in your hibernate+ehcache application:
2008-11-20 13:02:42,937 WARN (CacheManager.java:322) - 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 D:\apache-tomcat-5.5.26\temp\ehcache_auto_created_1227178962937. 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"> net.sf.ehcache.hibernate.SingletonEhCacheProvider </property>
July 30th, 2009 at 8:52
THANK YOU!!!!
January 26th, 2010 at 12:04
[...] 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. [...]
May 1st, 2010 at 20:27
[...] I was getting a WARN message if I used org.hibernate.cache.EhCacheProvider. I referred to this post for a [...]