在我的追求,我的Grails应用程序进行个性化的Ehcache,我添加了以下XML来配置目录:异常的Grails应用程序定制ehcache.xml中抛出后
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" >
<diskStore path="/path/to/store/data"/>
<cacheManagerEventListenerFactory class="" properties=""/>
<defaultCache
maxEntriesLocalHeap="10000"
eternal="false"
timeToLiveSeconds="120">
<persistence strategy="none"/>
</defaultCache>
<cache name="Book"
maxEntriesLocalHeap="10000"
timeToIdleSeconds="300"
/>
<cache name="org.hibernate.cache.UpdateTimestampsCache"
maxEntriesLocalHeap="10000"
timeToIdleSeconds="300"
/>
<cache name="org.hibernate.cache.StandardQueryCache"
maxEntriesLocalHeap="10000"
timeToIdleSeconds="300"
/>
</ehcache>
出乎我的意料,开始的时候,Grails的应用程序停止例外:
Caused by: net.sf.ehcache.CacheException: Error configuring from input stream. Initial cause was null:9: Element <defaultCache> does not allow attribute "maxEntriesLocalHeap".
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:152)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:99)
... 30 more
任何提示?我正在使用grails 1.3.9;谢谢。
若要将旧属性与“persistence”元素进行比较,请参阅:http://www.ehcache.org/documentation/2.8/configuration/fast-restart.html#compatibility-with-previous-versions – 2016-03-15 08:22:29