解决某些特殊情况下获取网卡信息失败导致启动失败的问题
This commit is contained in:
@@ -357,7 +357,11 @@ public class Server {
|
|||||||
private String getServerIp(IConfig config) {
|
private String getServerIp(IConfig config) {
|
||||||
String serverIp = config.getProperty(BrokerConstants.SERVER_IP_PROPERTY_NAME);
|
String serverIp = config.getProperty(BrokerConstants.SERVER_IP_PROPERTY_NAME);
|
||||||
if (serverIp == null || serverIp.equals("0.0.0.0")) {
|
if (serverIp == null || serverIp.equals("0.0.0.0")) {
|
||||||
serverIp = Utility.getLocalAddress().getHostAddress();
|
if(Utility.getLocalAddress() != null) {
|
||||||
|
serverIp = Utility.getLocalAddress().getHostAddress();
|
||||||
|
} else {
|
||||||
|
serverIp = "0.0.0.0";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return serverIp;
|
return serverIp;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user