报错:Web server failed to start. Port 9002 was already in use.端口被占用解决(Windows)

简介: 报错:Web server failed to start. Port 9002 was already in use.端口被占用解决(Windows)

场景

在开发的时候,启动了项目,端口也是占用的,如果发生了意外,关掉了项目,比如IDEA突然关了或者卡死了,你不得不重新打开,重新去启动的时候,发现启动不了了,控制台的信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 9002 was already in use.
Action:
Identify and stop the process that's listening on port 9002 or configure this application to listen on another port.
Process finished with exit code 1


原因

启动原因说得非常明白,就是说端口被占用了,你只需要杀死相应的进程,重新启动即可。

操作

如果是Linux系统,找到相应的进程id,kill调即可。

此处记录Windows的场景,打开CMD界面:


C:\Users\shaonaiyi>netstat -ano |findstr "9002"
  TCP    0.0.0.0:9002           0.0.0.0:0              LISTENING       7900
  TCP    127.0.0.1:9002         127.0.0.1:52203        TIME_WAIT       0
  TCP    127.0.0.1:9002         127.0.0.1:52204        TIME_WAIT       0
  TCP    [::]:9002              [::]:0                 LISTENING       7900
C:\Users\shaonaiyi>taskkill /f /t /im "7900"
成功: 已终止 PID 7900 (属于 PID 2296 子进程)的进程。


然后重新启动项目即可。


相关文章
|
10月前
|
安全 网络协议 NoSQL
Web渗透-常见的端口及对其的攻击思路
本文介绍了常见网络服务端口及其安全风险,涵盖FTP、SSH、Telnet、SMTP、DNS、HTTP、SMB、数据库及远程桌面等20余个端口,涉及弱口令爆破、信息泄露、未授权访问、缓冲区溢出等典型漏洞,适用于网络安全学习与渗透测试参考。
1858 59
|
JavaScript 前端开发 Java
Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use;端口冲突的原理与解决方案
本文解决了Idea启动SpringBoot程序报错:Veb server failed to start. Port 8082 was already in use的问题,并通过介绍端口的使用原理和操作系统的端口管理机制,可以更有效地解决端口冲突问题,并确保Web服务器能够顺利启动和运行。 只有锻炼思维才能可持续地解决问题,只有思维才是真正值得学习和分享的核心要素。如果这篇博客能给您带来一点帮助,麻烦您点个赞支持一下,还可以收藏起来以备不时之需,有疑问和错误欢迎在评论区指出~
|
网络协议 Java Shell
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: 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-优雅草卓伊凡解决方案
java spring 项目若依框架启动失败,启动不了服务提示端口8080占用escription: 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-优雅草卓伊凡解决方案
1149 7
|
存储 Shell 开发工具
8-8|windows上Git报错
8-8|windows上Git报错
|
Java Spring
【亲测有效完结bug】org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exce
【亲测有效完结bug】org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exce
2626 0
|
Windows
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
【Windows】 Win10下报错:该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在“默认应用设置”页面中创建关联
2351 1
|
运维 安全 数据管理
数据管理DMS产品使用合集之windows上安装网关时,token都是新的,报错:无效的token,该怎么办
阿里云数据管理DMS提供了全面的数据管理、数据库运维、数据安全、数据迁移与同步等功能,助力企业高效、安全地进行数据库管理和运维工作。以下是DMS产品使用合集的详细介绍。
335 4
|
Shell PHP Windows
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
324 0
|
Java 开发工具 Spring
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
299 0
【Azure 应用服务】App Service 配置 Application Settings 访问Storage Account得到 could not be resolved: '*.file.core.windows.net'的报错。没有解析成对应中国区 Storage Account地址 *.file.core.chinacloudapi.cn
【Azure 应用服务】App Service 配置 Application Settings 访问Storage Account得到 could not be resolved: '*.file.core.windows.net'的报错。没有解析成对应中国区 Storage Account地址 *.file.core.chinacloudapi.cn
328 0