总结原因:win下开发springboot出现8080端口重复使用情况:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-08-10 11:21:51.051 ERROR 14816 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Web server failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.


Process finished with exit code 1

打开cmd后,输入命令 netstat -o -n -a | findstr :8080

显示所有的端口占用情况

-a 显示所有连接和监听端口

-n 以数字形式显示地址和端口号。 此选项一般与 -a选项组合使用

-o 显示与每个连接相关的所属进程 ID

  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       7112
  TCP    192.168.1.6:53242      111.30.169.33:8080     ESTABLISHED     3320
  TCP    [::]:8080              [::]:0                 LISTENING       7112
  TCP    [2409:8a30:720:7640:3906:fb42:6035:6600]:49815  [2409:8c1e:8f60:1::2b]:8080  ESTABLISHED     3220

法一:直接终止  PID

taskkill /F /PID 7112

note:

 法二:根据PID找到运行的.exe,终止该程序

tasklist|findstr “16544”

taskkill /f /t im java.exe   (终止该程序)

 note:也可以去任务管理器找到.exe终止

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐