Tomcat 8.x
1. conf/logging.properties 修改:
# To see debug messages in TldLocationsCache, uncomment the following line:
org.apache.jasper.compiler.TldLocationsCache.level = FINE2. 重启Tomcat,启动成功后,打开日志文件catalina.out,看到很多行如下的日志:
No TLD files were found in.....xxx.jar
3. 把所有2中出现的jar加到排除扫描的列表中,打开catalina.properties, 添加进去: tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\
Linux下可使用如下命令把相关的Jar导出到一个文件中:
egrep "No TLD files were found in \[file:[^\]+\]" catalina.out -o | egrep "[^]/]+.jar" -o | sort | uniq | sed -e 's/.jar/.jar,\\/g' > skips.txt4. 重启Tomat,可看到之前的提示消息已经没有了,重新注释掉步骤1中的代码,完成修改。
本文介绍如何通过配置调整来减少Tomcat启动时的TLD文件扫描,包括修改logging.properties以显示详细信息,根据日志信息排除不必要的JAR文件扫描,并重新启动Tomcat以验证更改。
540

被折叠的 条评论
为什么被折叠?



