严重: Error starting heartbeat. Error was: Can't assign requested address
This was caused by an IPv6 address being returned from java.net.NetworkInterface.getDefault(). I'm on a Macbook and was using wireless -- p2p0 (used for AirDrop) was returned as the default network interface but my p2p0 only has an IPv6 ether entry [found by running ipconfig].
Two solutions, both of which worked for me (I prefer the first because it works whether you are using a wired or wireless connection)
Start the JVM with -Djava.net.preferIPv4Stack=true. This caused java.net.NetworkInterface.getDefault() to return my vboxnet0 network interface -- not sure what you'll get if you're not running a host-only VM.
Turn off wireless and use a wired connection
This was caused by an IPv6 address being returned from java.net.NetworkInterface.getDefault(). I'm on a Macbook and was using wireless -- p2p0 (used for AirDrop) was returned as the default network interface but my p2p0 only has an IPv6 ether entry [found by running ipconfig].
Two solutions, both of which worked for me (I prefer the first because it works whether you are using a wired or wireless connection)
Start the JVM with -Djava.net.preferIPv4Stack=true. This caused java.net.NetworkInterface.getDefault() to return my vboxnet0 network interface -- not sure what you'll get if you're not running a host-only VM.
Turn off wireless and use a wired connection
本文解决了一个Java应用程序中出现的心跳错误问题,该错误是由于IPv6地址被分配给了默认网络接口而引起的。提供了两种解决方案:一是通过设置JVM参数-Djava.net.preferIPv4Stack=true来优先使用IPv4地址;二是关闭无线连接并使用有线连接。
8393

被折叠的 条评论
为什么被折叠?



