Tomcat版本】7.0.42
【问题描述】Tomcat启动后,访问动态页面后提示“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”
【问题原因猜测】Tomcat7/Servlet3.0 新增特性“可插性支持”实现的原理应该是自动扫描jar,当jar中并不包含相关组件时会打印该信息
【问题处理】从提示信息来看,不处理也可以,但对于有洁癖的、追求完美的程序员而言这个是不允许的。具体处理步骤:
1.调整Tomcat对应类的log级别
修改${tomcat}/conf/log4j.properties
##解除类org.apache.jasper.compiler.TldLocationsCache的log
org.apache.jasper.compiler.TldLocationsCache.level = FINE
2.观察Tomcat日志打印信息
步骤1执行完后,重启Tomcat,观察Tomcat日志,会在日志中发现类似如下打印信息:
九月 09, 2013 10:55:37 上午 org.apache.jasper.compiler.TldLocationsCache tldScanJar
详细: No TLD files were found in [file:/E:/devspace/xxt_login/WEB-INF/lib/json-lib-2.3-jdk15.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip or org.apache.catalina.startup.TldConfig.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
九月 09, 2013 10:55:37 上午 org.apache.jasper.compiler.TldLocationsCache tldScanJar
详细: No TLD files were found in [file:/E:/devspace/xxt_login/WEB-INF/lib/poi-3.8.jar]. Consider adding the JAR to the tomcat.util.scan.DefaultJarScanner.jarsToSkip or org.apache.catalina.startup.TldConfig.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
3.调整${tomcat}/conf/catalina.properties,将提示的jar添加到不扫描清单中