精选圈子榜单优站
编程综合
编程综合
技术
20关注
编程技术记录、分享 ,记录你的编程生活点点滴滴!

tomcat8启动慢解决: At least one JAR was scanned for TLDs yet contained no TLDs.


b3b7d0a20cf431adfe004e4e4e36acaf2fdd98f2.jpg

部署某个旧项目时候,发现启动特别慢,要等好几分钟。然后每次部署都停留在

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.

jdk环境是1.8,tomcat版本是8.0.


上下文日志:


securerandom.source=file:/dev/./urandom
15-Nov-2018 09:56:13.331 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 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.
15-Nov-2018 09:59:29.043 WARNING [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [195,690] milliseconds.

可以看到,就是这个:

Creation of SecureRandom instance

导致了启动时间变长。




解决方案有两个:

1)在Tomcat环境中解决

可以通过配置JRE使用非阻塞的Entropy Source。

在catalina.sh中加入这么一行:

-Djava.security.egd=file:/dev/./urandom

即可。

2)在JVM环境中解决

打开$JAVA_PATH/jre/lib/security/java.security这个文件,找到下面的内容:

securerandom.source=file:/dev/urandom

替换成

securerandom.source=file:/dev/./urandom

  • 若文章侵犯了您的权益,请联系我们进行处理。

  • 2018-11-15
  • 5647阅读
评论