Environmental information:
CentOS Release 6.8
tomcat-8.0
JDK1.8
First, start Tomcat
#sh/root/tomcat-8.0/bin/startup.sh
#tailf/root/tomcat-8.0/logs/catalina.out
--aug- . A: -:31.661INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector forServlet write/Read --aug- . A: -:31.662INFO [main] org.apache.catalina.startup.Catalina.load initialization processedinch 680Ms --aug- . A: -:31.685INFO [main] org.apache.catalina.core.StandardService.startInternal starting service Catalina --aug- . A: -:31.685INFO [main] org.apache.catalina.core.StandardEngine.startInternal starting Servlet Engine:apache tomcat/8.0. + --aug- . A: -:31.695INFO [localhost-startstop-1] Org.apache.catalina.startup.HostConfig.deployDirectory deploying Web Application directory/root/tomcat-8.0/webapps/ROOT --aug- . A: -:36.184INFO [localhost-startstop-1] Org.apache.jasper.servlet.TldScanner.scanJars at least one JAR was scanned forTLDs yet contained no TLDs. Enable Debug Logging for ThisLogger forA complete list of JARs this were scanned but no TLDs were foundinchthem. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. --aug- . A: -:37.895INFO [localhost-startstop-1] java.util.prefs.filesystempreferences$2. Run Created System Preferences DirectoryinchJava.home. --aug- . A: -:37.897INFO [localhost-startstop-1] java.util.prefs.filesystempreferences$1. Run Created User Preferences directory. --aug- . A: -:37.907WARNING [localhost-startstop-1] java.util.prefs.filesystempreferences$6. run Prefs file removedinchbackground/root/.java/.userprefs/Prefs.xml --aug- . A: -:37.908WARNING [localhost-startstop-1] java.util.prefs.filesystempreferences$6. run Prefs file removedinchbackground/root/jdk-1.8/jre/.systemprefs/prefs.xml
... ...
Waiting for Tomcat to start the process is suffering, a full 5/6 minutes, in the hope of the case it actually started to complete ...
There are two ways to solve this problem:
1) solve in Tomcat environment
Add this line to the catalina.sh:
-djava.security.egd=file:/dev/./urandom
For example:
java_opts="-djava.security.egd=file:/dev/./urandom"
2) Resolve in the JVM environment
Modify $java_path/jre/lib/security/java.security
Securerandom.source=file:/dev/urandom
Replaced by
Securerandom.source=file:/dev/./urandom
Troubleshooting Linux Server tomact-8.0 boot slow