4 Replies Latest reply on Apr 28, 2017 4:15 AM by Jiří Holuša

    max-entries=-1 is not accepted for overridden named cache.

    Ulab S Newbie

      Hello,

      I have below configuration in standalone.xml. The custom cache named "data-local-query" defines the max-entries="-1" which is valid as per documentation to have unlimited entries.

      But it seems there is a conflict with default local cache and WildFly startup error. Why cannot I define max-entries="-1" to override default one ?

       

      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>

       

      log error

      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)