Tomcat cache errors when using icon library on 2.32

Dear Implementers,

@Calle_Hedberg noticed an issue with the Tomcat cache when running DHIS2 version 2.32 (on a Windows 10 PC) and loading the new icon library (e.g. when change icon is selected for a program in the Maintenance app). The following errors were raised in the Tomcat log:

24-Jul-2019 18:24:55.720 WARNING [http-nio-8080-exec-3] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/SVGs/chills_positive.svg] to the cache for web application [/dhis] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
24-Jul-2019 18:24:55.732 WARNING [http-nio-8080-exec-1] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/SVGs/cholera_positive.svg] to the cache for web application [/dhis] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
24-Jul-2019 18:24:55.727 WARNING [http-nio-8080-exec-2] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/SVGs/cholera_outline.svg] to the cache for web application [/dhis] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
24-Jul-2019 18:24:55.736 WARNING [http-nio-8080-exec-10] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/SVGs/church_outline.svg] to the cache for web application [/dhis] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
24-Jul-2019 18:24:55.742 WARNING [http-nio-8080-exec-4] org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/classes/SVGs/church_positive.svg] to the cache for web application [/dhis] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache

We cannot reproduce the problem on our play servers, but if you see a similar issue on your servers it can be avoided by explicitly setting the cacheMaxSize in the context.xml file of the Tomcat configuration:

 <Context>
   <Resources cachingAllowed="true" cacheMaxSize="100000" />
   <WatchedResource>WEB-INF/web.xml</WatchedResource>
   <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
</Context>

(Thanks to @luciano for the solution!).

Kind regards,
Phil

1 Like