Grails:解决“服务器无法为端口 8080 启动:地址已在使用中".

编程入门 行业动态 更新时间:2024-10-26 10:34:20
本文介绍了Grails:解决“服务器无法为端口 8080 启动:地址已在使用中".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在尝试解决Server failed to start for port 8080: Address already in use"时遇到此错误

I'm getting this error when trying to resolve "Server failed to start for port 8080: Address already in use"

Error executing script 8888: For input string: ""

有人可以帮忙吗?不知道怎么回事.谢谢.

Can anybody help? Don't know what's wrong. Thanks.

推荐答案

当8080端口已经被使用而你想复用同一个端口时,你应该杀掉它的进程:

When the port number 8080 is already used and you want to reuse the same port , you should kill its process :

首先,检查使用端口 8080 的进程的 pid.为此运行:

First, check the pid of the process that is using port 8080. To do this run:

lsof -w -n -i tcp:8080

在上面的例子中,使用端口 9090 的进程的 pid 是 3812

In the example above, the pid is 3812 for process that is using port 9090

注意PID.您机器上的 PID 可能不同.我们需要这个来执行下一个命令:

Take note of the PID. The PID could be different on your machine. We need this for executing the next command:

所以你必须通过 run-app 来测试它:

so you will have to test it via run-app:

grails run-app

更新:作为 lsof -w -n -i tcp:8080| 的输出awk '{print $2}'|awk 'END{print}' 是 PID, 可以通过PID自动杀死端口进程:

UPDATE : As the output of lsof -w -n -i tcp:8080| awk '{print $2}'|awk 'END{print}' is the PID , You can kill the port process by PID automatically :

kill -9 `lsof -w -n -i tcp:8080| awk '{print $2}'|awk 'END{print}'`

更多推荐

Grails:解决“服务器无法为端口 8080 启动:地址已在使用中".

本文发布于:2023-08-07 03:34:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1316735.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:已在   端口   地址   服务器   Grails

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!