Tomcat启动时Creation of SecureRandom instance for session ID很慢
2016-03-11 10:57
549 查看
启动tomcat很慢,检查后发现:
[localhost-startStop-1]
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [131,830] milliseconds。
主要时间都花在Creation of SecureRandom instance上了。
百度谷歌了一番。。
解决办法:
打开$JAVA_HOME/jre/lib/security/java.security这个文件,找到下面的内容:
securerandom.source=file:/dev/urandom
替换成
securerandom.source=file:/dev/./urandom
然而并没有什么卵用。。
检查后发现linux下的的java -version和javac -version的版本不一致,可能是这个原因。。
修复了版本不一致的问题,问题依旧。。
最后仔细检查了下,发现$JAVA_HOME/jre/lib/security/java.security中用的是file:/dev/./random!前面少了个u!!所以上面的解决办法没生效就很正常了,改成file:/dev/urandom后,重启tomcat,sucess!
详见:http://security.stackexchange.com/questions/89/feeding-dev-random-entropy-pool
参考:
http://blog.csdn.net/chszs/article/details/49494701
http://stackoverflow.com/questions/26431922/tomcat7-starts-too-late-on-ubuntu-14-04-x64-digitalocean
[localhost-startStop-1]
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [131,830] milliseconds。
主要时间都花在Creation of SecureRandom instance上了。
百度谷歌了一番。。
解决办法:
打开$JAVA_HOME/jre/lib/security/java.security这个文件,找到下面的内容:
securerandom.source=file:/dev/urandom
替换成
securerandom.source=file:/dev/./urandom
然而并没有什么卵用。。
检查后发现linux下的的java -version和javac -version的版本不一致,可能是这个原因。。
修复了版本不一致的问题,问题依旧。。
最后仔细检查了下,发现$JAVA_HOME/jre/lib/security/java.security中用的是file:/dev/./random!前面少了个u!!所以上面的解决办法没生效就很正常了,改成file:/dev/urandom后,重启tomcat,sucess!
详见:http://security.stackexchange.com/questions/89/feeding-dev-random-entropy-pool
参考:
http://blog.csdn.net/chszs/article/details/49494701
http://stackoverflow.com/questions/26431922/tomcat7-starts-too-late-on-ubuntu-14-04-x64-digitalocean
相关文章推荐
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- i-jetty环境搭配与编译
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 实现单Tomcat多Server配置
- 生产环境下的Tomcat配置
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- Linux部署Tomcat服务器
- c++11 + SDL2 + ffmpeg +OpenAL + java = Android播放器