Friday 15 August 2014

caching - Tomcat 8 throwing - org.apache.catalina.webresources.Cache.getResource -



caching - Tomcat 8 throwing - org.apache.catalina.webresources.Cache.getResource -

i have upgraded 7.0.52 8.0.14.

i getting lots of static image files:

org.apache.catalina.webresources.cache.getresource unable add together resource @ [/base/1325/wa6144-150x112.jpg] cache because there insufficient free space available after evicting expired cache entries - consider increasing maximum size of cache

i haven't specified particular resource settings, , didn't 7.0.52.

i have found mention of happening @ startup in bug study supposedly fixed. me happening not @ startup when resource requested.

is else having issue?

thanks.

trying @ to the lowest degree disable cache, cannot find illustration of how specify not utilize cache. attributes have gone context in 8. have tried adding resource cannot config right.

<resource name="file" cachingallowed="false" classname="org.apache.catalina.webresources.fileresourceset" />

(i don't have plenty reputation yet comment, maybe reply answers question bit.)

i have same issue when upgrading tomcat 7 8: continuous big flood of log warnings cache.

possible cause

an explanation why these warnings didn't occur in tomcat 7, may implementation didn't back upwards warnings. tomcat 8 outputs warning @ code line:

105 if (newsize > maxsize) {106 // unable create sufficient space resource107 // remove cache108 removecacheentry(path);109 log.warn(sm.getstring("cache.addfail", path));110 }

while corresponding tomcat 7 code line probably:

1606 // add together new entry cache1607 synchronized (cache) {1608 // check cache size, , remove elements if big1609 if ((cache.lookup(name) == null) && cache.allocate(entry.size)) {1610 cache.load(entry);1611 }1612 }

if these assumptions correct, tomcat 7 doesn't output warnings while tomcat 8 does. unusual thing wouldn't expect default tomcat 8 configuration output such amount of log warnings bit trivial (cache) create defaults unusable.

options

you (/we) have next options:

disable cache increase cache (although may delay problem in high load/traffic situation) suppress cache log warnings 1. disable cache

you can disable cache setting cachingallowed false. http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

although can remember in beta version of tomcat 8, using jmx disable cache. (not sure why exactly, there may problem disabling cache via server.xml.)

to enable jmx, add together server.xml:

<listener classname="org.apache.catalina.mbeans.jmxremotelifecyclelistener" rmiregistryportplatform="6767" rmiserverportplatform="6768" />

then utilize jconsole connect on jmx server , though settings settings disable cache while server running. changes in these settings should take impact immediately.

2. increment cache

as described here: http://tomcat.apache.org/tomcat-8.0-doc/config/resources.html

3. suppress cache log warnings

as described here: http://tomcat.apache.org/tomcat-8.0-doc/logging.html logger outputting warnings "org.apache.catalina.webresources.cache".

discussion

the question remains open why tomcat 8 has such flood of warnings enabled default.

caching resources tomcat8

No comments:

Post a Comment