Linux下的tomcat停止命令出现Connection refused错误

停止tomcat的时候运行./shutdown.sh命令报如下错误

[root@iz2zefq26zde3w3vbtf00dz bin]# ./shutdown.sh 
Using CATALINA_BASE:   /tomcat7.0/apache-tomcat-7.0.47
Using CATALINA_HOME:   /tomcat7.0/apache-tomcat-7.0.47
Using CATALINA_TMPDIR: /tomcat7.0/apache-tomcat-7.0.47/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /tomcat7.0/apache-tomcat-7.0.47/bin/bootstrap.jar:/tomcat7.0/apache-tomcat-7.0.47/bin/tomcat-juli.jar
Nov 22, 2017 10:21:34 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Nov 22, 2017 10:21:34 AM 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:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:580)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.(Socket.java:429)
    at java.net.Socket.(Socket.java:209)
    at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:500)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)

搞了大半个小时,才发现了是Io网卡不知怎么的关了
启用lo网卡,然后重新停止tomcat成功

[root@iz2zefq26zde3w3vbtf00dz bin]# ifup lo
[root@iz2zefq26zde3w3vbtf00dz bin]# ./shutdown.sh 
Using CATALINA_BASE:   /tomcat7.0/apache-tomcat-7.0.47
Using CATALINA_HOME:   /tomcat7.0/apache-tomcat-7.0.47
Using CATALINA_TMPDIR: /tomcat7.0/apache-tomcat-7.0.47/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /tomcat7.0/apache-tomcat-7.0.47/bin/bootstrap.jar:/tomcat7.0/apache-tomcat-7.0.47/bin/tomcat-juli.jar

没有报错啦,记录一下

你可能感兴趣的:(Tomcat)