Jenkins+Tomcat服务器配置过程中,修改了tomcat配置文件;然后再访问服务器的tomcat页面发现根本加载不出来
企图重启tomcat
/opt/tomcat/bin/shutdown.sh
出现如下报错
[root@izbp1fmfc2pdjiw9u143xfz conf]# /opt/tomcat/bin/shutdown.sh Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar 二月 20, 2020 1:37:22 下午 org.apache.catalina.startup.Catalina stopServer 严重: Could not contact [localhost:8005]. Tomcat may not be running. 二月 20, 2020 1:37:22 下午 org.apache.catalina.startup.Catalina stopServer 严重: Catalina.stop: java.net.ConnectException: 拒绝连接 (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at java.net.Socket.connect(Socket.java:556) at java.net.Socket.<init>(Socket.java:452) at java.net.Socket.<init>(Socket.java:229) at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:504) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:389) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:479)
经查证,出现这种报错的原因是Tomcat尚未启动完成;
接下来尝试了强制关闭tomcat
ps -ef | grep tomcat 查看tomcat进程号 kill -9 + 进程号 杀死进程
重新启动tomcat
/opt/tomcat/bin/startup.sh
tomcat页面依旧无法加载
打印tomcat运行日志
[root@izbp1fmfc2pdjiw9u143xfz conf]# cd /opt/tomcat [root@izbp1fmfc2pdjiw9u143xfz tomcat]# ls bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work [root@izbp1fmfc2pdjiw9u143xfz tomcat]# cd logs [root@izbp1fmfc2pdjiw9u143xfz logs]# ls catalina.2020-02-20.log host-manager.2020-02-20.log localhost_access_log.2020-02-20.txt catalina.out localhost.2020-02-20.log manager.2020-02-20.log [root@izbp1fmfc2pdjiw9u143xfz logs]# tail -f catalina.out 20-Feb-2020 13:48:35.239 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat 20-Feb-2020 13:48:35.239 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat 20-Feb-2020 13:48:35.239 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp 20-Feb-2020 13:48:35.239 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] 20-Feb-2020 13:48:35.348 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"] 20-Feb-2020 13:48:35.391 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Feb-2020 13:48:35.403 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 895 ms 20-Feb-2020 13:48:35.487 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 20-Feb-2020 13:48:35.487 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.51 20-Feb-2020 13:48:35.524 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [/opt/tomcat/webapps/docs]
发现运行日志卡在最后一行:localhost-startStop-1
,无法向下继续进行
解决方案:
将$ JAVA_HOME / jre / lib / security / java.security
文件中的securerandom.source
参数修改为文件:/ dev /./ urandom
[root@izbp1fmfc2pdjiw9u143xfz logs]# cd $JAVA_HOME/jre/lib/security [root@izbp1fmfc2pdjiw9u143xfz security]# ls blacklisted.certs cacerts java.policy java.security nss.cfg policy [root@izbp1fmfc2pdjiw9u143xfz security]# vi java.security
顺带一提,在vi中快速搜索的方法:
命令模式下输入“/字符串”,例如“/Section 3”。如果查找下一个,按“n”即可。
总结
以上就是快速解决Tomcat重新配置后启动慢的问题的详细内容,更多关于tomcat启动慢请关注其它相关文章!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 群星《红色经典》限量1:1母盘直刻[低速原抓WAV+CUE]
- 苗子杰.1993-SUN.SHINE【歌林】【WAV+CUE】
- 吕方.1990-不舍得你【华纳】【WAV+CUE】
- 刘若英.2005-一整夜【大熊星】【WAV+CUE】
- 刘锐/王星《牧者影视配乐精选·贰》[FLAC/分轨][271.13MB]
- 林一峰《作业》[320K/MP3][185.25MB]
- 林一峰《作业》[FLAC/分轨][511.47MB]
- 魔兽世界永久60级奶骑天赋怎么点 永久60级奶骑天赋推荐
- 魔兽世界永久60级矮人牧师怎么玩 永久60级矮人牧师玩法指南
- 炉石传说40血卡组代码一览 2024最新全职业40血卡组代码大全
- 《如龙:极》NS实体版确认!35美元 25年3月发货
- 日本离谱忍者游戏将登NS:手柄插进屁股进行对决
- 《神之天平外传》NS版今日发售 可独立于本体运行
- 群星《24K德国HD金碟红色经典》2CD[WAV+CUE]
- 妙音唱片群星《红色经典DSD1-2》2CD[低速原抓WAV+CUE]