IO Error: Connection reset by peer, Authentication lapse 140354 ms.问题的解决

今天在公司服务器上搭建新环境,部署项目时,一切准备就绪了,但是却发现项目总是启动失败,启动日志报:“IO Error: Connection reset by peer, Authentication lapse 140354 ms…”这个错误。
因为这个错误是在数据库连接时报出来的,我第一反应是数据库连接异常——权限问题,可能是密码或用户名有误,找了dba确认密码,用户名无误后,就开始寻找其他突破口,google是个好东西,oracle官网给出来了一个解决方案,如下:

#oracle文档的地址
https://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmrand.html

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 WebLogic SIP Server 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, BEA recommends using /dev/urandom if the default JVM configuration delays WebLogic SIP Server 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
If the command returns immediately, you can use /dev/random as the default generator for SUN’s JVM. If the command does not return immediately, use these steps to configure the JVM to use /dev/urandom:
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.

我来试着给大家翻译一下:

避免因随机数生成而导致的JVM延迟
在UNIX平台上,Sun的JVM中用于随机数生成的库默认依赖于/ dev / random。可能会阻止WebLogic SIP Server进程,因为在某些操作系统上/ dev / random会在返回结果之前等待主机上产生一定量的“干扰”。尽管/ dev / random更安全,但如果默认JVM配置延迟WebLogic SIP Server启动,BEA建议使用/ dev / urandom。
要确定你的操作系统是否出现此行为,请尝试在shell提示符下显示该文件的一部分:
head -n 1 / dev / random如果命令立即返回,则可以使用/ dev / random作为SUN JVM的默认生成器。如果命令未立即返回,请使用以下步骤将JVM配置为使用/ dev / urandom:
在文本编辑器中打开$ JAVA_HOME / jre / lib / security / java.security文件。
更改这一行配置:securerandom.source = file:/ dev / random
改为这个:securerandom.source = file:/ dev / urandom
保存更改并退出文本编辑器。

我试了,确实解决了tomcat服务启动异常的问题。如果有遇到相同问题的,可以试着这样解决。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值