Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16236

Cache warning messages in catalina.out in debian xwiki-tomcat8-* packages



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.11, 11.1
    • Fix Version/s: 11.2-rc-1
    • Component/s: Distribution - Debian
    • Labels:
    • Environment:
      google-compute-engine deployment of XWiki running on  "Ubuntu 18.04.2 LTS" using its tomcat8 (8.5.30) mysql (5.7.25) and openjdk-8-jre-headless (8u191-b12) packages: 
    • Difficulty:
    • Documentation:
    • Documentation in Release Notes:
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:


      Although closed, the following issue XWIKI-15756 still occurs in 11.1 and 10.11 debian packaging. 

      I noted mass-spewage of errors in /var/log/tomcat8/catalina.out – many repeated lines like:

      "Unable to add the resource at [/WEB-INF/lib/xwiki-platform-container-servlet-11.1.xed] to the cache for web application [/xwiki] because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache"

       Note that /usr/lib/xwiki/META-INF/context.xml has

      <!-- We need to set the resource cache size since the default (10K) is too small for loading all XWiki resources at once -->
       <Resources cacheMaxSize="20480" />

      however it's not clear that gets loaded with current config (it doesn't):

      Looking at logs it loads /etc/tomcat8/Catalina/localhost/xwiki.xml

      08-Mar-2019 00:20:20.169 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor [/etc/tomcat8/Catalina/localhost/xwiki.xml]

      where in /etc/tomcat8/Catalina/localhost:

      lrwxrwxrwx 1 root tomcat8 28 Feb 25 09:41 xwiki.xml -> /etc/xwiki/xwikitomcat8.xml

      So I did following, also integrating suggestions from
      and specifically from

      • added my changes to /etc/tomcat8/context.xml (just like vmassol suggests above)
      • and the errors still happen....
      • tried again increasing cache size to 50K...
      • and it still happens....

      So I went back and did two things:

      (1) set /etc/xwiki/xwiki.cfg per Admin.CheckXWikiConfig suggestion:

      Now CheckXWikiConfig admin-tools app reports:

      Cache configuration
      This lists the main cache settings. An XWiki instance is set by default to 100 for the main cache which is ok for a small instance. A large one with at least 1000 (large XE) to 3000 (very large XE or large XEM).
      Store Page Cache Capacity : 1000
      Store Page Cache in Use : 379

      (2) added to /etc/xwiki/xwiki-tomcat8.xml

      • --> note, put everything in one "Resources" clause, wondering if different resource clauses are overriding previously defined ones instead of additive?
      • (NB: this may be reason for OP having XWiki not startup at all as I had similar issues with adding two "Resources" entries within one context in early attempts).
      • --> e.g. there is a setting to "20,480" in the package-installed /usr/lib/xwiki/META-INF/context.xml and a separate one ("<Resources allowLinking="true".../>") in xwiki-tomcat8.xml ?
      • --> per tomcat8 docs, set cacheObjectMaxSize to cacheMaxSize/20 ... and tripled orig size of cacheMaxSize from default 10240 (10Mb)
        to 30Mb (30720), raising cacheObjectMaxSize from default 512 (512 kilobytes) to 1536 (1.5 megabytes). 
      <Context path="/xwiki" docBase="/usr/lib/xwiki" privileged="true" crossContext="true">
        <!-- NPM: fix /var/log/tomcat8/catalina.out errors (See http://jira.xwiki.org/browse/XWIKI-15756?focusedCommentId=100290&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-100290 )
             "Unable to add the resource at ... to the cache for web application /xwiki because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache" 
             /usr/lib/xwiki/META-INF/context.xml's cacheMaxSize="20480" does not
             appear to be applied in the case of this xwiki apt/debian setup. -->
        <!-- Make symlinks work in Tomcat -->
        <Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="30720" cacheObjectMaxSize="1536" />
        <!-- Disable JAR scanning since Xwiki does not need that -->
        <JarScanner scanClassPath="false"> <JarScanFilter defaultTldScan="false"/> </JarScanner>



          Issue Links



              nielsmayer Niels Mayer, http://nielsmayer.com
              nielsmayer Niels Mayer, http://nielsmayer.com
              0 Vote for this issue
              2 Start watching this issue


                Date of First Response: