zoukankan      html  css  js  c++  java
  • Could not contact [localhost:8005]. Tomcat may not be running.

    出错环境介绍:

    Tomcat-version:8.5.56

    JDK-version:1.8.0_152

    Linux:CentOS-7

    错误信息

    sh /opt/apache-tomcat-8.5.56/bin/shutdown.sh
    Using CATALINA_BASE:   /opt/apache-tomcat-8.5.56
    Using CATALINA_HOME:   /opt/apache-tomcat-8.5.56
    Using CATALINA_TMPDIR: /opt/apache-tomcat-8.5.56/temp
    Using JRE_HOME:        /opt/jdk1.8.0_152
    Using CLASSPATH:       /opt/apache-tomcat-8.5.56/bin/bootstrap.jar:/opt/apache-tomcat-8.5.56/bin/tomcat-juli.jar
    Oct 07, 2020 3:13:26 PM org.apache.catalina.startup.Catalina stopServer
    SEVERE: Could not contact [localhost:8005]. Tomcat may not be running.
    Oct 07, 2020 3:13:26 PM org.apache.catalina.startup.Catalina stopServer
    SEVERE: Catalina.stop: 
    java.net.ConnectException: Connection refused (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:589)
    	at java.net.Socket.connect(Socket.java:538)
    	at java.net.Socket.<init>(Socket.java:434)
    	at java.net.Socket.<init>(Socket.java:211)
    	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 started.然后修改了项目需要重启Tomcat,执行shutdown.sh报错如上所描述

    解决参考链接: https://stackoverflow.com/questions/36566401/severe-could-not-contact-localhost8005-tomcat-may-not-be-running-error-while

    报错信息提到连接被拒绝,可能是Tomcat没有在运行,网上搜索相关资料说原因好像是JDK8的bug

    解决方案一:直接修改JDK配置(不推荐)

    解决办法二:修改cataline.sh的内容:文件头部添加一行指令

    JAVA_OPTS=-Djava.security.egd=file:/dev/./urandom
    
  • 相关阅读:
    MongoDB+模板引擎 项目实例-学生档案管理
    MongoDB 增删改查命令速查
    MongoDB 数据库概述及环境搭建
    Flutter 升级
    TypeScript 快速上手及学习笔记
    Android ContentProvider 启动分析
    HTTP 报文格式简介
    深入浅出 HTTPS (详解版)
    从你输入网址,到看到网页——详解中间发生的过程
    TCP 三次握手和四次挥手图解(有限状态机)
  • 原文地址:https://www.cnblogs.com/juyss/p/13777532.html
Copyright © 2011-2022 走看看