我有以下警告当应用程序启动。
2009-05-13 09:19:41,171 WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath:jar:file:/app/java/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
我发现encache代码在以下网址.. ConfigurationFactory Code
应用程序试图加载ehcache.xml中却找不到该文件,然后它加载的Ehcache-failsafe.xml.I想知道这是否会导致应用程序的任何问题?什么是冲击载荷的Ehcache-failsafe.xml?
加载ehcache-failsafe.xml
不会导致本身的问题;但它最有可能不是最优的应用程序。
有没有办法的Ehcache开发商知道你打算什么缓存;因此ehcache-failsafe.xml
包含在分发尝试提供一些“最小公分母”设置,将工作或多或少确定在大多数情况下。你得到一个警告,提醒指定配置,这将是更适合您的特定需求。
ehcache.xml
应该在你的classpath
,特别在WEB-INF/classes/
推出。然后,您可以根据您的环境中它指定您的需求。
这是一个例子:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache>
<diskStore path="java.io.tmpdir"/>
<cache name="org.hibernate.cache.UpdateTimestampsCache"
maxElementsInMemory="50000"
eternal="true"
overflowToDisk="true"/>
<cache name="org.hibernate.cache.StandardQueryCache"
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
<defaultCache
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
3年后,希望我的回答可以帮助别人。
如果你正在使用的Ehcache作为第二级缓存提供商休眠变化:hibernate.cache.provider_configuration_file_resource_path与net.sf.ehcache.configurationResourceName的Ehcache将能够找到您的配置,然后。