Catalina cache warnings: Unable to add the resource to the cache

Article ID:216567087
1 minute readKnowledge base

Issue

Apache Tomcat logs, e.g. logs/catalina.out continuously report:

  • Unable to add the resource to the cache

  • Insufficient free space available after evicting expired cache entries

  • Consider increasing the maximum size of the cache

21-Nov-2019 14:33:17.211 WARNING [http-nio-80-exec-4] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/plugins/dockerhub-notification.hpi] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache

Resolution

As per Supported platforms for CloudBees Core on traditional platforms, CloudBees only supports two versions of Apache Tomcat and strives to support the latest GA version.

Apache Tomcat 8.5 support ended on 2019-10-31.

Increase the cache size parameter. Add/edit cacheMaxSize within the Context XML element of your $CATALINA_BASE/conf/context.xml. The Resources component inside the <Context block should fix the issue, see https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html

<Resources
    cachingAllowed="true"
    cacheMaxSize="100000"
/>

The value may be changed while the web application is running (e.g. via JMX). Increasing the cacheMaxSize value should clean up the cache warnings you were noticing.

An alternative approach would be to completely disable cache

<Resources
    cachingAllowed="false"
/>