Grails:正在解析“服务器无法为端口8080启动:地址已在使用中”。

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

我在尝试解析服务器无法启动端口8080时出现此错误:地址已在使用中

Error executing script 8888: For input string: ""

任何人都可以帮忙吗?不知道什么是错的。当端口号8080已经被使用,并且你想重复使用同一个端口时,你应该终止它的进程:

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

推荐答案

首先,检查使用端口8080的进程的pid。要做到这一点,请运行:

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

lsof -w -n -i tcp:8080

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

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

UPDATE:作为的输出结果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:35:37,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:已在   端口   地址   服务器   Grails

发布评论

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

>www.elefans.com

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