运行报“端口号被占用“的处理方法:The Tomcat connector configured to listen on port 8080 failed to start.

报错日志显示由于8080端口已被使用,导致Tomcat无法启动。解决方法包括检查并停止使用该端口的进程,或者修改应用配置以监听其他未使用的端口。在Windows环境下,可以通过`netstat -ano`命令查找占用端口的进程,并在任务管理器中结束相应进程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错日志:

[2020-12-30 14:14:05.894] 0.stdout.ERROR #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:Failed to start connector [Connector[HTTP/1.1-8080]] 
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8080]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
	at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:256)
	at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:198)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
	at com.gt.crm.GtCrmApplication.main(GtCrmApplication.java:69)
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	... 13 common frames omitted
Caused by: java.net.BindException: Address already in use: bind
	at sun.nio.ch.Net.bind0(Native Method)
	at sun.nio.ch.Net.bind(Net.java:433)
	at sun.nio.ch.Net.bind(Net.java:425)
	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
	at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
	at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150)
	at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591)
	at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018)
	... 14 common frames omitted
[2020-12-30 14:14:05.899] 0.stdout.INFO  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:Pausing ProtocolHandler ["http-nio-8080"] 
[2020-12-30 14:14:05.899] 0.stdout.INFO  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:Stopping service [Tomcat] 
[2020-12-30 14:14:05.908] 0.stdout.WARN  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748) 
[2020-12-30 14:14:05.909] 0.stdout.WARN  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43) 
[2020-12-30 14:14:05.911] 0.stdout.INFO  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:The stop() method was called on component [StandardServer[-1]] after stop() had already been called. The second call will be ignored. 
[2020-12-30 14:14:05.911] 0.stdout.INFO  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:Stopping ProtocolHandler ["http-nio-8080"] 
[2020-12-30 14:14:05.911] 0.stdout.INFO  #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:Destroying ProtocolHandler ["http-nio-8080"] 
[2020-12-30 14:14:05.919] 0.stdout.ERROR #traceId:0 host:0 from:0 uri:0 clientIp:0 rpcId:0 userId:0 totalTime:0 asyncTime:0 file:0 sqlCostTime:0 requestParams: requestBodys: responseResults: line:0 msg:

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

本例是占用的8080端口,其他端口处理方式也同理:

  1. Windows+R 打开命令窗口输入cmd
  2. 窗口里敲命令:
netstat -ano //查看系统当前所有的端口使用情况

如图:
在这里插入图片描述

netstat -ano |findstr "8080"//8080换成你想查看的端口号

查看到对应的进程id之后
![在这里插入图片描述](https://img-blog.csdnimg.cn/2020123014304247.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQxOTAzMzU0,size_16,color_FFFFFF,t_70

  1. 打开任务管理器,如图,选择和id相等的PID,然后结束进程,就ok了
    在这里插入图片描述
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值