7,496,082 th visitor since 2017.2.1 ( Today : 1136 )
Programming
No. 837
Name. swindler
Subject. tomcat 시작시 시간이 오래 걸릴 때 (Jar 파일 스캔)
Main Cate. JSP/Servlet
Sub Cate.
Date. 2024-07-24 15:59
Hit. 809 (121.134.199.74)
File.
톰캣 구동시에 jar 파일 탐색으로 인하여 속도가 꽤 느릴 수 있다.

톰캣 구동시에 다음과 같은 로그가 찍힌다.
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.

jar파일에 커스텀 태그와 관련된 TLD 파일이 없을 때 발생하는데, TLD 파일이 없는 jar 파일을 탐색하는 것이 시간 낭비이며 jar 파일이 많은 경우 시간이 꽤 걸린다.

톰캣 설정 파일 logging.properties에서 아래와 같이 로그 레벨을 FINE으로 변경한다.

# 탐색하는 jar 파일 목록 출력

org.apache.catalina.startup.ContextConfig.level = FINE

# TLD 관련 로그 출력

org.apache.jasper.servlet.TldScanner.level = FINE


톰캣 실행시 다음과 같은 로그가 출력된다.
Jul 24, 2024 3:51:11 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
FINE: Scanning jar file for class files with annotations [jar:file:/usr/share/java/tomcat-jsp-2.2-api.jar!/]


해당 jar 파일을 Scan 한다는 뜻인다.

다음과 같이 catalina.properties 에서 Skip할 대상을 추가할 수 있다.

tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
...
xom-*.jar,\
tomcat*.jar,\
apache*.jar







[바로가기 링크] : http://coolx.net/cboard/develop/837



Name
Password
Comment
* 해당 배너는 쿠팡 파트너스 활동의 일환으로, 이에 다른 일정액의 수수료를 제공받습니다.
Copyright © 1999-2017, swindler. All rights reserved. 367,611 visitor ( 1999.1.8-2004.5.26 ), 2,405,771 ( -2017.01.31)

  2HLAB   2HLAB_Blog   RedToolBox