我在standalone.xml
中有以下配置。名为data-local-query
的自定义缓存定义了max-entries="-1"
,该文件对于具有无限条目的文档是有效的。
但似乎与默认local cache
存在冲突,因此WildFly存在启动错误。
为什么我不能定义max-entries="-1"
来覆盖默认值?
错误
Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled
standalone.xml
<cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
<local-cache name="entity">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="local-query">
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="data-local-query">
<eviction strategy="LRU" max-entries="-1"/>
<expiration max-idle="14400" interval="20000" lifespan="86400000"/>
</local-cache>
<local-cache name="timestamps"/>
</cache-container>
日志错误
2017-04-19 18:00:27,215 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 62) MSC000001: Failed to start service jboss.infinispan.hibernate.data-local-query.config: org.jboss.msc.service.StartException in service jboss.infinispan.hibernate.data-local-query.config: org.infinispan.commons.CacheConfigurationException: Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled
Caused by: org.infinispan.commons.CacheConfigurationException: Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled
at org.infinispan.configuration.cache.EvictionConfigurationBuilder.validate(EvictionConfigurationBuilder.java:108)
at org.infinispan.configuration.cache.ConfigurationBuilder.validate(ConfigurationBuilder.java:203)
at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:246)
at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:236)
at org.wildfly.clustering.infinispan.spi.service.ConfigurationBuilder.start(ConfigurationBuilder.java:79)
at org.wildfly.clustering.service.AsynchronousServiceBuilder$1.run(AsynchronousServiceBuilder.java:102)