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

  • 相关阅读:
    用JavaScript 实现变速回到顶部
    导出数据到Excel
    Jquery ajax调用webService,远程访问出错解决办法
    火狐和IE的window.event对象详解
    硬盘、U盘添加漂亮背景
    JS 获取当前日期时间(兼容IE FF)
    Base64编码
    师生关系
    关于计算机导论的问题
    自我介绍
  • 原文地址:https://www.cnblogs.com/hurner/p/6401471.html
Copyright © 2011-2022 走看看