码迷,mamicode.com
首页 > 编程语言 > 详细

java.security.NoSuchAlgorithmException: SHA1PRNG SecureRandom not available

时间:2017-08-05 11:49:08      阅读:422      评论:0      收藏:0      [点我收藏+]

标签:myeclipse   creat   manager   number   cep   lan   soc   with   instance   

q好久没有使用MyEclipse10了,今天打开看了以前大学的项目,在Tomcat7中发布启动,我嚓嘞,报错:

SEVERE: Exception initializing random number generator using algorithm [SHA1PRNG]
java.security.NoSuchAlgorithmException: SHA1PRNG SecureRandom not available
    at sun.security.jca.GetInstance.getInstance(Unknown Source)
    at java.security.SecureRandom.getInstance(Unknown Source)
    at org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom(SessionIdGeneratorBase.java:210)
    at org.apache.catalina.util.SessionIdGeneratorBase.getRandomBytes(SessionIdGeneratorBase.java:174)
    at org.apache.catalina.util.StandardSessionIdGenerator.generateSessionId(StandardSessionIdGenerator.java:34)
    at org.apache.catalina.util.SessionIdGeneratorBase.generateSessionId(SessionIdGeneratorBase.java:167)
    at org.apache.catalina.util.SessionIdGeneratorBase.startInternal(SessionIdGeneratorBase.java:256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.session.ManagerBase.startInternal(ManagerBase.java:714)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:461)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5643)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

 看到这个错误,一头雾水,从来没有见过这个错误,以为是tomcat7的缘故,又换位tomcat6,发布启动之后,我叉,有出现错误:

SEVERE: Cannot find message associated with key managerBase.digest
java.security.NoSuchAlgorithmException: MD5 MessageDigest not available
    at sun.security.jca.GetInstance.getInstance(Unknown Source)
    at java.security.Security.getImpl(Unknown Source)
    at java.security.MessageDigest.getInstance(Unknown Source)
    at org.apache.catalina.session.ManagerBase.getDigest(ManagerBase.java:478)
    at org.apache.catalina.session.ManagerBase.generateSessionId(ManagerBase.java:1220)
    at org.apache.catalina.session.StandardManager.start(StandardManager.java:636)
    at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:448)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4665)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:803)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:676)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:602)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:503)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:325)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1069)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

然后,干脆就去掉项目,单独的启动tomcat6 和 tomcat7,我叉,还是一样的错误,这说明 原来的项目是没有问题的,那就是 MyEclipse10 和 tomcat的原因了。

因为tomcat6和tomcat7 依赖的是 JDK7,所以报了这个错,原因还不清楚,但是在eclipse中 tomcat6 和 tomcat7 是可以使用JDK7的。于是,把tomcat6 和 tomcat7 依赖的JDK7换为 MyEclipse10自带的JDK6,重新启动tomcat,我叉,真的就没有问题了。

 

java.security.NoSuchAlgorithmException: SHA1PRNG SecureRandom not available

标签:myeclipse   creat   manager   number   cep   lan   soc   with   instance   

原文地址:http://www.cnblogs.com/xbq8080/p/7289558.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!