问题:
Tomcat启动时卡在org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory
记录一下,以后再遇到,就不用心慌慌了,说实话,昨天弄这个问题就是这样,弄到最后心态崩了,以为是自己能力不行了,开始怀疑自己。
造成这个问题的原因是,linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom ,两个有区别,urandom安全性没有random高,但random需要时间间隔生成随机数,可能是我用的阿里云的CentOS 7.4 64位的系统不兼容这个东西吧!
解决办法:
进入$JAVA_HOME/jre/lib/security/路径,修改securerandom.source文件的内容改为file:/dev/./urandom
修改前:
securerandom.source=file:/dev/random
修改后:
securerandom.source=file:/dev/./urandom
也可以用"#"注释原内容。