zoukankan      html  css  js  c++  java
  • tomcat createSecureRandom 花费了将近10分钟

    http://www.th7.cn/Program/java/201603/776312.shtml

    启动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

  • 相关阅读:
    spring-ioc
    Hibernate之二级缓存
    hibernate之HQL语句
    hibernate 多对多关联关系
    hibernate关联关系(一对多)
    Hibernate之主键生成策略
    struts2的CRUD
    struts2的OGNL
    struts2的初步认识
    Maven介绍
  • 原文地址:https://www.cnblogs.com/hurner/p/6401471.html
Copyright © 2011-2022 走看看