https://bz.apache.org/bugzilla/show_bug.cgi?id=69605

            Bug ID: 69605
           Summary: Possibility to clear the notFoundClassResource cache
                    from within a running webapp
           Product: Tomcat 9
           Version: 9.0.97
          Hardware: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: so...@his.de
  Target Milestone: -----

tl;dr: Would it be possible to clear the notFoundClassResource cache from
within a running webapp?

Long version: 
I am filling this report against 9.0.97 because this is the version where the
notFoundClassResource cache was first introduced. Since the cache was also
implemented for tomcat 10.x and 11.x, this report probably also applies to
these versions, but I only verified it for tomcat >= 9.0.97 

Due to the introduction of the cache, our webapp did not start on machines
where tomcat.util.scan.StandardJarScanFilter.jarsToSkip was set to "*.jar" in
the catalina.properties. Here's why: 

1. During startup tomcat processes the web.xml of our webapp. In this webapp we
reference class files that reside in jars. Since we excluded all jars, the
class files are marked as missing in the notFoundClassResource cache. 
2. A little bit later we now add the jars with the help of the URLClassLoader. 
3. Still a little bit later spring tries to load one of these class files from
the jars, but fails to do so because the classes are already marked as missing
in the cache. 

Our current workaround is to either set
tomcat.util.scan.StandardJarScanFilter.jarsToSkip to its default value or to
deactivate the cache. 

However, we would like to have both mechanisms enabled to speed up the startup
process. 

Would it be possible to add a mechanism for clearing the notFoundClassResource
cache from within the webapp? In that case, we could simply clear the cache
after we added jars to the classpath.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to