Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
来源:互联网 发布:北京金山软件年终奖 编辑:程序博客网 时间:2024/06/05 10:33
转载自:http://blog.csdn.net/njchenyi/article/details/46641141
Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
第一次遇到Tomcat在Linux服务器启动卡住的情况,情况很简单,tomcat启动以后卡在INFO: Deploying web application directory ......这句话,具体会卡多久就没测试了。google、baidu都没找到解决方法。
幸亏UCloud的技术支持人员给出了解决方案。
找到jdk1.x.x_xx/jre/lib/security/Java.security文件,在文件中找到securerandom.source这个设置项,将其改为:
securerandom.source=file:/dev/./urandom
这时候根据修改内容就可以查到因为此原因不仅可以造成tomcat卡住,也会造成weblogic启动缓慢,
linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom ,两个有区别,urandom安全性没有random高,但random需要时间间隔生成随机数。jdk默认调用random。
再后来,终于在weblogic的官方文档中 Monitoring and Troubleshooting 找到了 Avoiding JVM Delays Caused By Random Number Generation 这样一个标题。摘录如下:
The library used for random number generation in Sun's JVM relies on /dev/random by default for UNIX platforms. This can potentially block the Oracle WebLogic Communication Services process because on some operating systems /dev/random waits for a certain amount of "noise" to be generated on the host machine before returning a result. Although /dev/random is more secure, oracle recommends using /dev/urandom if the default JVM configuration delays Oracle WebLogic Communication Services startup.
To determine if your operating system exhibits this behavior, try displaying a portion of the file from a shell prompt:
head -n 1 /dev/random
Open the $JAVA_HOME/jre/lib/security/java.security file in a text editor.
Change the line:
securerandom.source=file:/dev/random
to read:
securerandom.source=file:/dev/urandom
Save your change and exit the text editor.
其中说到:可通过 head -n 1 /devrandom 查看是否你的系统会出现伪随机数提供等待。OK就这个,试了一下,果然,在服务器第一次启动后,这个可以快速提供一个值,但当再次调用时发生等待。
解决办法:
永久:oracle 说修改 $JAVA_HOME/jre/lib/security/java.security 文件,替换securerandom.source=file:/dev/random 为 securerandom.source=file:/dev/urandom。对所有使用JVM的应用生效。(这个永久的方法,这里面有个问题,就是设置时候实际应该设置为securerandom.source=file:/dev/./urandom,否则不生效)
DOMAIN临时:修改startWeblogic.sh文件,JAVA_OPTIONS="${SAVE_JAVA_OPTIONS} -Djava.security.egd=file:/dev/./urandom"
后继的SecureRandom 测试学习
编写JAVA类如下,运行测试,第一次正常,第二次等待,重启服务器后第一次又正常。启动加入参数 -Djava.security.egd=file:/dev/./urandom 正常
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- tomcat启动时卡在“INFO: Deploying web application directory .”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- Tomcat启动时卡在“INFO: Deploying web application directory ”
- Tomcat启动时卡在 INFO HostConfig.deployDirectory Deploying web application directory
- 启动tomcat时,一直卡在Deploying web application directory这块的解决方案
- 解决启动tomcat时,一直卡在Deploying web application directory的问题
- 启动tomcat的时候一直卡在INFO: Deploying web application
- 启动tomcat时,一直卡在Deploying web application directory解决方案
- tomcat 部署 卡在INFO: Deploying web application
- tomcat时,一直卡在Deploying web application directory这块的解决方案
- Tomcat8启动时的Error deploying web application directory错误
- 近5年典型的的APT攻击事件
- spark demo之wordcount和K-means
- 一起来点React Native——常用组件之Image
- 【dp】递推 zoj3747
- 当Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Tomcat启动时卡在“INFO: Deploying web application directory ......”的解决方法
- poj2337 字典序 欧拉回路/欧拉道路
- 深入探索grep的单引号双引号,以及单双引号互相包含的情况
- 遇到HashSet_jni.h错误导致编译中止的问题
- 编辑距离问题+滚动数组优化
- ORACLE正则表达式
- C/C++ string类型转换int类型
- 解决Pixhawk启动解锁过程中出现一些问题
- HDU 3790 最短路径问题 (最短路变形