请教各位,我在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里
true
true
org.hibernate.cache.EhCacheProvider
ehcache.xml里
timeToIdleSeconds="60" timeToLiveSeconds="60" overflowToDisk="true"
diskSpoolBufferSizeMB="30" maxElementsOnDisk="1000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="60"
memoryStoreEvictionPolicy="LRU" />
说下自己的经历吧 : 我之前是只写了自己的 缓存.没有写 默认的
[code="xml"]<?xml version="1.0" encoding="UTF-8"?>
<diskStore path="java.io.tmpdir" />
<cache name="sampleCache1" maxElementsInMemory="10000" eternal="false"
timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="true" />
[/code]
启动的时候报没有默认缓存配置的 WARN , 后来加上就好了[code="xml"] maxElementsInMemory="10000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU" />
[/code]