欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

报错Connection refused: connect

程序员文章站 2022-07-07 14:42:14
...

 

报错Connection refused: connect

内容如下:

二月 14, 2019 2:16:48 下午 org.apache.catalina.startup.Catalina stopServer
严重: Could not contact [localhost:[8005]]. Tomcat may not be running.
二月 14, 2019 2:16:48 下午 org.apache.catalina.startup.Catalina stopServer
严重: Catalina.stop: 
java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
	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.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	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:503)
	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:406)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:498)

 

多次启动tomcat,导致8080端口号被占用了,找到那个端口号,然后kill掉对应的进程就行啦。

利用命令提示符:

输入“netstat -aon|findstr 8080”找到占用8080端口的进程号:

报错Connection refused: connect

输入“tasklist|findstr "3412" ”:

查看进程号为“3412”的进程:

报错Connection refused: connect

输入“taskkill /f /t /im QQ.exe”:

结束这个进程:

报错Connection refused: connect