eclipse java.net.BindException:地址已在使用:绑定

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36613038/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:37:54  来源:igfitidea点击:

java.net.BindException: Address already in use: bind

eclipseglassfish-4

提问by user3505775

I get an error using glassfish like this : java.net.BindException: Address already in use: bind, but i think i have changed the port of the server like this:

使用 glassfish 时出现错误,如下所示:java.net.BindException: Address already in use: bind,但我想我已经像这样更改了服务器的端口:

enter image description here

在此处输入图片说明

And i think i have changed the port to be 9999. But nothing is effected. This is all port was used on my computer.

我想我已将端口更改为 9999。但没有任何影响。这是我电脑上使用的所有端口。

how to fix it?, i see the server port using 8080. I think it makes the port depedency with port url. is it true and how to fix it? enter image description here

如何修复?,我看到服务器端口使用 8080。我认为它使端口依赖于端口 url。这是真的吗?如何解决? 在此处输入图片说明

回答by unwichtich

As the error message clearly says: The port is in use.

正如错误消息明确指出的那样:端口正在使用中。

The netstatoutput shows there is a connection to BNI-PC:4848. This is the port the Glassfish Admin Frontend should run on, this means there is already an instance of Glassfish running on your computer.

netstat输出显示有一个连接BNI-PC:4848。这是 Glassfish 管理前端应该运行的端口,这意味着您的计算机上已经有一个 Glassfish 实例正在运行。

Also, if something is running on port 8080, Glassfish won't start with the default settings.

此外,如果端口 8080 上正在运行某些程序,Glassfish 将不会以默认设置启动。

Changing the debug port doesn't help you, this has nothing to do with the other two ports.

更改调试端口对您没有帮助,这与其他两个端口无关。

You should close Eclipse and then kill all remaining Java processes via the task manager to solve the problem.

您应该关闭 Eclipse,然后通过任务管理器杀死所有剩余的 Java 进程以解决问题。

If you really want to change the ports, make sure that Glassfish is not running, open domain.xmlinside ../glassfish4/glassfish/domains/domain1/config/and search for 8080 to change the main http port and search for 4848 to change the Glassfish Admin UI port.

如果确实要更改端口,请确保 Glassfish 未运行,打开domain.xml内部../glassfish4/glassfish/domains/domain1/config/并搜索 8080 以更改主 http 端口,搜索 4848 以更改 Glassfish Admin UI 端口。

Hint: You can use netstat -a -b(required admin rights) to see which process is using the ports.

提示:您可以使用netstat -a -b(需要管理员权限)查看哪个进程正在使用端口。

回答by yogesh joshi

Open domain.xmlinside ../glassfish4/glassfish/domains/domain1/config/and search for 8080 and change it to something else for the main http port.

domain.xml在里面打开../glassfish4/glassfish/domains/domain1/config/并搜索 8080 并将其更改为主 http 端口的其他内容。

回答by u7733902

My solution is as follows: open the task manager, find the java.exe process, close it, or restart the computer.

我的解决方法是:打开任务管理器,找到java.exe进程,关闭,或者重启电脑。