tomcat报错:地址localhost:8080已在使用中的解决方法

来自:网络
时间:2023-06-15
阅读:

1.运行代码后,报错:地址 localhost:8080 已在使用中

tomcat报错:地址localhost:8080已在使用中的解决方法

 2.查看8080端口,是否被占用。Windows+R,弹出运行窗口,输入cmd,然后Enter键,如下图进入运行窗口。

tomcat报错:地址localhost:8080已在使用中的解决方法

3.在运行窗口,输入:netstat -ano,然后Enter,如下图1。弹出下图2,发现TCP 0.0.0.0:8080,说明8080窗口已经被占用,进程PID是11572

tomcat报错:地址localhost:8080已在使用中的解决方法

图1

tomcat报错:地址localhost:8080已在使用中的解决方法

图2 

4.输入tasklist,然后Enter键,弹出如下图3:找到8080对应的11572,就可以知道那个程序占用8080端口。

tomcat报错:地址localhost:8080已在使用中的解决方法

图3

 如下图4,所示ApplicationWebServer.exe,占用了8080端口。

tomcat报错:地址localhost:8080已在使用中的解决方法

图4

或者输入:netstat -aon|findstr 端口号   查看端口号是否被占用;

输入:tasklist|findstr “PID数字”  可以直接查询那个程序占用了端口号。

5.进入任务管理器,找到ApplicationWebServer.exe,终止此任务程序。就可以重新运行程序代码,并进入8080端口。

tomcat报错:地址localhost:8080已在使用中的解决方法

 运行结果如下图,可以进入Tomcat的8080端口:

tomcat报错:地址localhost:8080已在使用中的解决方法

返回顶部
顶部