问题|中断IDEA-端口被占用 @SpringBoot

问题描述:

背景:

  • IEDA中,在SpringBoot项目还在运行状态时,突然关闭IDEA。
    再次打开,并启动项目时,报端口错误
The Tomcat connector configured to listen on port 8080 failed to start.

具体:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-05 12:55:36.879 ERROR 19848 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
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.

2021-01-05 12:55:36.880  INFO 19848 --- [  restartedMain] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@4a97f566: startup date [Tue Jan 05 12:55:34 CST 2021]; root of context hierarchy
2021-01-05 12:55:36.882  INFO 19848 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

Process finished with exit code 0



原因分析:

原因:

  • 8080端口被占用

说明:

  • 自己在中途关闭IEDA时,选了Disconnect,导致没有终止进程,所以端口依旧在占用着
  • 正确操作:选择Terminate → 关闭进程
    在这里插入图片描述

解决方法:

想法:关闭端口
操作:查看进程 杀死进程

打开cmd(按 WIN+R键打开运行,输入cmd)

1.查看端口被谁占用-进程的Pid   netstat -aon|findstr 【端口号】

2.window下强制杀死该进程      taskkill -f -pid 【进程号】
如:
netstat -aon|findstr 8080
taskkill -f -pid 20876

示例:
在这里插入图片描述
效果:再次启动SpringBoot项目 成功
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值