user2992389
user2992389

Reputation: 191

Tomcat startup speed up by skipping scanning jars, if I skip all jars, why didn't throw a ClassNotFound exception?

I want to speed up Tomcat startup skipping scanning jars, but there are lots of jars, that I can't figure one by one, so I want to skip all jars, but I am not sure what will happen, is a classNotFound exception, or a much more slow start-up?

I add configuration as below into catalina.properties, and my project still speed up by 10 seconds without error. So I want to know why it didn't throw a ClassNotFound exception. ```

tomcat.util.scan.DefaultJarScanner.jarsToSkip=*.jar
org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar
org.apache.catalina.startup.TldConfig.jarsToSkip=*.jar

```

Upvotes: 0

Views: 1881

Answers (1)

Elliott Frisch
Elliott Frisch

Reputation: 201487

You are skipping services that tomcat can provide, not loading of the classes (which is handled by the classloader). These services look for configuration, annotations (and/or other metadata), to configure context and (from TldConfig) Startup event listener for a Context that configures application listeners configured in any TLD files.

Upvotes: 1

Related Questions