Ehcache缓存警告问题?

采姑娘的小蘑菇 发布于 2010/01/06 21:21
阅读 2K+
收藏 0

请教各位,我在spring+hibernate里配置Ehcache缓存,出现以下警告,请问是什么原因呢?

警告: Creating a new instance of CacheManager using the diskStorePath "D:\Apache Tomcat 6.0.18\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 6.0.18\temp\ehcache_auto_created_1262783591937.
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.

applicationContext.xml里

<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>

ehcache.xml里

<ehcache>
 <diskStore path="java.io.tmpdir" />
 <defaultCache maxElementsInMemory="10000" eternal="false"
  timeToIdleSeconds="60" timeToLiveSeconds="60" overflowToDisk="true"
  diskSpoolBufferSizeMB="30" maxElementsOnDisk="1000000"
  diskPersistent="false" diskExpiryThreadIntervalSeconds="60"
  memoryStoreEvictionPolicy="LRU" />
</ehcache>

加载中
0
w
wcl_friend
我也遇到这个问题了,解决不了,求教啊。。。。。。。。。。。
0
tommcat
tommcat
你的 ehcache.xml 是否和applicationContext.xm放在同一个目录里? 我的经验是最好放在一起,否则spring会去加载一个缺省的ehcache.xml
返回顶部
顶部