第一次遇到Tomcat在Linux服务器启动卡住的情况,情况很简单,tomcat启动以后卡在INFO: Deploying web application directory ......这句话,具体会卡多久就没测试了。google、baidu都没找到解决方法。

幸亏UCloud的技术支持人员给出了解决方案。

找到jdk1.x.x_xx/jre/lib/security/java.security文件,在文件中找到securerandom.source这个设置项,将其改为:

securerandom.source=file:/dev/./urandom

这时候根据修改内容就可以查到因为此原因不仅可以造成tomcat卡住,也会造成weblogic启动缓慢,

linux或者部分unix系统提供随机数设备是/dev/random 和/dev/urandom ,两个有区别,urandom安全性没有random高,但random需要时间间隔生成随机数。jdk默认调用random。

再后来,终于在weblogic的官方文档中 Monitoring and Troubleshooting 找到了 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 Oracle WebLogic Communication Services 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, Oracle recommends using /dev/urandom if the default JVM configuration delays Oracle WebLogic Communication Services 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

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.

其中说到:可通过 head -n 1 /devrandom 查看是否你的系统会出现伪随机数提供等待。OK就这个,试了一下,果然,在服务器第一次启动后,这个可以快速提供一个值,但当再次调用时发生等待。

解决办法:

永久:oracle 说修改 $JAVA_HOME/jre/lib/security/java.security 文件,替换securerandom.source=file:/dev/random 为 securerandom.source=file:/dev/urandom。对所有使用JVM的应用生效。(这个永久的方法,这里面有个问题,就是设置时候实际应该设置为securerandom.source=file:/dev/./urandom,否则不生效)

DOMAIN临时:修改startWeblogic.sh文件,JAVA_OPTIONS="${SAVE_JAVA_OPTIONS} -Djava.security.egd=file:/dev/./urandom"

[localhost-startStop-1]的更多相关文章

  1. zookeeper报错java.net.ConnectException: Connection refused: no further information

    zookeeper报错java.net.ConnectException: Connection refused: no further information 这是在linux 启动 https:/ ...

  2. 2003-Can't connect to mysql server on localhost (10061)

    mysql数据库出现2003-Can't connect to mysql server on localhost (10061)问题 解决办法:查看wampserver服务器是否启动,如果没有启动启 ...

  3. MySql Access denied for user 'root'@'localhost' (using password:YES) 解决方案

    关于昨天下午说的MySQL服务无法启动的问题,解决之后没有进入数据库,就直接关闭了电脑. 今早打开电脑,开始-运行 输入"mysql -uroot -pmyadmin"后出现以下错 ...

  4. Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds

    错误:Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds 错误提示就是我们限定了部署的时间导致的错 ...

  5. ssh无密码登录The authenticity of host 'localhost (::1)' can't be established.

    The authenticity of host 'localhost (::1)' can't be established. http://blog.csdn.net/cyuyan112233/a ...

  6. phpmyadmin #1045 - Access denied for user 'root'@'localhost' (using password: NO)

    phpmyadmin访问遇到1045问题 #1045 - Access denied for user 'root'@'localhost' (using password: NO) 解决办法 找到p ...

  7. eclipse启动tomcat, http://localhost:8080无法访问

    原地址 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能访问. 关闭eclipse里面的 ...

  8. 解决ssh localhost中root@localhost:要求输入密码问题(已经进行了无密码设置登录)

    首先删除~/.ssh目录下的3个文件,如下 id_rsa authorized_keys id_rsa.pub 然后 exit # 退出刚才的 ssh localhostcd ~/.ssh/ # 若没 ...

  9. MySql数据库:Host 'localhost' is not allowed to connect to this MySQL server

    修改mysql的root密码后,出现Host 'localhost' is not allowed to connect to this MySQL server 错误. 解决办法: C:\Progr ...

  10. 诡异的localhost无法连接

    上午试了localhost发现提示无法连接,ping了下localhost,能够ping通. 重启了Apache,还是无法解决. 试着停止了Apache服务,然后再连接localhost,发现浏览器提 ...

随机推荐

  1. vue学习笔记(一) ---- vue指令(总体大纲)

    一.什么是Vue 官方文档:https://cn.vuejs.org/v2/guide/ 关键字: 渐进式框架 自底向上增量开发 视图层 单文件组件 复杂的单页应用 复杂的单页应用: 顾名思义,单页应 ...

  2. axios设置全局headers

    需求:每次请求的时候都设置token为headers非常不方便 axios提供配置全局headers 这里我主要使用的是加 一个token验证 Global axios defaults axios. ...

  3. 2021级《JAVA语言程序设计》上机考试试题3

    ok,现在是学生的界面实现,因为代码上篇都给出来了,那个是打分卡里面要求全了的,然后service,servlet不全,嗯,刚刚忘说了,没写完,就写了那么多. 先注册: 代码如下: <%@ pa ...

  4. javascript的防抖与节流

    一.节流 一段时间内只能触发一次,如果这段时间内触发多次事件,只有第一次生效会触发回调函数,一段时间过后才能再次触发(一定时间内只执行第一次) 应用场景 1.鼠标连续不断地触发某事件(如点击),只在单 ...

  5. OWASP 靶机下载

    OWASP靶机下载安装详细过程一. OWASP靶机下载二. VM虚拟机三. OWASP安装四. OWASP启动运行一. OWASP靶机下载下载地址:https://sourceforge.net/pr ...

  6. 数据对接:从Notion Database到低代码平台

    前言 Notion简介 近几年,有一款叫Notion的产品异常火爆,它是集笔记.任务管理.Wiki.数据管理为一体的产品,他主打两个理念「模块化」和「All-in-one」,Notion最有魅力的还是 ...

  7. angr初探

    前言 在搞fuzz的时候发现了一个比较难以解决的问题.例如if(*buf == "\xde\xad\xbe\xef"),我们如果想通过纯fuzz去进入这个if的分支,那么概率极其微 ...

  8. 用ChatGPT,快速设计一个真实的账号系统

    hi,我是熵减,见字如面. 用ChatGPT,可以尝试做很多的事情. 今天我们就来让ChatGPT做为架构师,来帮我们设计一个账号系统吧. 我的实验过程记录如下,与你分享. 用户故事 首先,我们从用户 ...

  9. 数位 dp,但是做题笔记

    这玩意儿还要学自己推不出来的 SX 是屑. 数位 dp,顾名思义,是根据数位做 dp,每个数位每个数位转移,炒个例子 windy 数. 求 \([l, r]\),我们改成求 \(1\sim r\) 与 ...

  10. Wayland比X11慢的若干解决办法

    1. 直接解决 1.1 kernel设置问题 有人测试树莓派上树莓派上Manjaro使用X11性能好于Wayland,下面解释说是kernel问题,并给出了一些修改建议,详见: X11 vs Wayl ...