gpt4 book ai didi

java.net.BindException : Cannot assign requested address

转载 作者:行者123 更新时间:2023-11-30 03:24:24 27 4
gpt4 key购买 nike

我想在我的应用程序中使用低端口(Spring web + Tomcat7 上的 SNMP 陷阱接收器)。正如我在这个帖子中所说的 Binding Low Port to Java Program on Ubuntu Server ,之前,我收到错误 Permission Denied。然后我将tomcat7用户组更改为root。但在那之后,我得到了 java.net.BindException: Cannot allocate requested address 错误。对于我尝试的每个端口(低端口或高端口),我总是收到此错误。

我检查端口是否已使用,我发现该端口仍然空闲。我检查我的/etc/host内容,它是这样的:

127.0.0.1 localhost 
127.0.1.1 test-server
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
124.81.xx.x test-server.com

注意:我的操作系统是 ubuntu 服务器

最佳答案

您应该绑定(bind)到0.0.0.0,而不是尝试指定本地地址。

关于java.net.BindException : Cannot assign requested address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30611516/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com