Windows杀死进程的端口号 [英] Windows Kill Process By PORT Number

查看:347
本文介绍了Windows杀死进程的端口号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Spring Tool Suite IDE中使用嵌入式Tomcat服务器。我的问题是,当我运行我的项目时,出现以下错误,

I'm using embedded Tomcat server in Spring Tool Suite IDE. My problem is when I run my project there is an error as follows,

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

有一些类似的问题,但是没有一个答案对我不起作用。

There are some similar questions but none of the answers not working for me.

推荐答案


解决方案1:终止进程

Solution 1: Kill Process

以管理员身份运行命令行

netstat -ano | findstr :<yourPortNumber>
taskkill /PID <typeyourPIDhere> /F








解决方案2:更改端口

Solution 2: Change Port

请确保要为应用程序设置的新端口不监听任何端口其他过程

Change the port 
server.port=8088 # Server HTTP port.








解决方案3:
另一种方法是终止该过程(在IDE中)并清理和重建项目。

Solution 3: Another way is to terminate the process (in IDE) and clean and rebuild project.

更新:

对于解决方案2,请确保您要为Application设置的新端口不会监听任何其他进程

选项1

运行 resmon.exe 并转到 Network->监听端口(也可以在TaskManager上查看)

Run resmon.exe and go to Network -> Listening Port (Also can be viewed on TaskManager)

选项2

PowerShell

Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess

cmd

 C:\> netstat -a -b

(添加-n阻止它尝试解析主机名,

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

-a Displays all connections and listening ports.

-b 显示创建每个连接或侦听端口所涉及的可执行文件。在某些情况下,众所周知的可执行文件包含多个独立的组件,在这些情况下,将显示创建连接或侦听端口所涉及的组件顺序。在这种情况下,可执行文件的名称在底部的[]中,在顶部是其调用的组件,依此类推,直到达到TCP / IP。请注意,此选项可能很耗时,除非您具有足够的权限,否则它将失败。

-b Displays the executable involved in creating each connection or listening port. In some cases, well-known executables host multiple independent components, and in these cases, the sequence of components involved in creating the connection or listening port is displayed. In this case, the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.

-n 显示地址

-o 显示与每个连接关联的拥有进程ID。

-o Displays the owning process ID associated with each connection.

这篇关于Windows杀死进程的端口号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆