Monday, October 03, 2011

Tomcat 7 scans all jars for TLDs

Tomcat 7 scans all jars for TLDs. I am unsure if tomcat 6 does the same:
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Once the log level was increased to FINE in conf/logging.properties:
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE

We got:
...
FINE: No TLD files were found in [file:/opt/tomcat/webapps/nestorurquiza-app/WEB-INF/lib/org.springframework.transaction-3.0.5.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
Oct 3, 2011 2:05:58 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
FINE: No TLD files were found in [file:/opt/tomcat/webapps/nestorurquiza-app/WEB-INF/lib/jsr250-api-1.0.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
Oct 3, 2011 2:05:58 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
FINE: No TLD files were found in [file:/opt/tomcat/webapps/nestorurquiza-app/WEB-INF/lib/org.springframework.security.ldap-3.0.5.RELEASE.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
...

Solution

Add all the project jars to the list in catalina.properties. I will need to see a real impact in performance because of this issue before spending time filling this list out in all of our Tomcat servers.

4 comments:

Rose said...

I have the same issue, How did your testing go? Will it increase the performance?

Nestor Urquiza said...

I haven't tested it. This happens at the beginning of the deployment so if any the gain will have no impact in the application later on.

For now I am OK with the traces. But someone out there could prove me wrong and then I will take care of them at that moment.

rustynut1 said...

This happens because you reference one or more taglibs that can't be found in your war file.
If you copy all taglibs that you use into /META-INF, Tomcat won't scan all the jars for the tld's.
You can find c.tld and fmt.tld inside jstl.jar, and spring.tld in spring-webmvc.jar.

kanaparthi kiran said...

You might be missing old friends jstl.jar and standard.jar along with struts2 jars. You need to include them in WEB-INF/lib.

Followers