Why does Tomcat skip the scanning jars specified in DefaultJarScanner.jarsToSkip
Asked Answered
A

1

6

In catalina.properties it says:

# List of JAR files that should not be scanned for configuration information
# such as web fragments, TLD files etc. It must be a comma separated list of
# JAR file names.
# The JARs listed below include:
# - Tomcat Bootstrap JARs
# - Tomcat API JARs
# - Catalina JARs
# - Jasper JARs
# - Tomcat JARs
# - Common non-Tomcat JARs
# - Sun JDK JARs
# - Apple JDK JARs
tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\

Can anyone explain WHY? For example, you have to include the jstl.jar in your libs, but if it's called jstl.jar, it skips it. I just don't understand what the point of skipping it is in the first place?

Ataman answered 11/8, 2012 at 1:38 Comment(0)
D
13

The comment says it all: "files that should not be scanned for configuration information" ie. if you know that your jars don't have any configuration information, include them here, so tomcat won't look into it.

The bottom line is this: it will cut the time tomcat takes to finish booting.

It seems not very useful on small deployments, but believe me: it does make a huge difference in big deployments with hundreds of jar files.

If jars are not included, or if there is not a pattern to skip (such as a*.jar - to exclude everything that starts with "a"), then everything gets opened, read, to find out about configuration.

In the company I work for, we are using TC Server which is just a fancy Tomcat: without the patterns to skip jars, tc server takes about 20 minutes just to scan the jar files... then another 10 minutes to deploy everything.

When we added patterns to skip pretty much 99% , we were able to cut down the server startup to about 12 minutes - not perfect, but the whole thing is huge, therefore, it's a tradeof we accepted.

Downy answered 12/2, 2013 at 15:6 Comment(2)
I understand the reason to include a jar in this property but jstl.jar contains configuration information. By default, it is included in this property. I don't understand the reason for it being added by tomcat/apache.Seizure
And I don't understand this "magic" configuration information. If some of the jars have configuration information why not list them explicitly. I google around for "configuration information in jars" and don't find anything much appropriate except some stuff about code signing.Polemoniaceous

© 2022 - 2024 — McMap. All rights reserved.