我在尝试解析服务器无法启动端口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-appUPDATE:作为的输出结果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启动:地址已在使用中”。
发布评论