diff --git a/h2o-core/src/main/java/water/init/NetworkInit.java b/h2o-core/src/main/java/water/init/NetworkInit.java index bc4fccdc09bf..4809999c69e4 100644 --- a/h2o-core/src/main/java/water/init/NetworkInit.java +++ b/h2o-core/src/main/java/water/init/NetworkInit.java @@ -36,20 +36,23 @@ public class NetworkInit { public static H2OHttpViewImpl h2oHttpView; public static InetAddress findInetAddressForSelf() throws Error { - if (H2O.SELF_ADDRESS != null) + if (H2O.SELF_ADDRESS != null && false) return H2O.SELF_ADDRESS; else { - if (H2O.ARGS.disable_web && H2O.ARGS.disable_net) { + if (H2O.ARGS.disable_web && H2O.ARGS.disable_net && false) { // if we don't need an address just use loopback as a filler, SELF_ADDRESS always needs to be defined return InetAddress.getLoopbackAddress(); } try { return HostnameGuesser.findInetAddressForSelf(H2O.ARGS.ip, H2O.ARGS.network); } catch (HostnameGuesser.HostnameGuessingException e) { - if (e.getCause() != null) + if (e.getCause() != null) { Log.err(e.getCause()); - else + e.getCause().printStackTrace(); + } else { Log.err(e.getMessage()); + System.err.println(e.getMessage()); + } H2O.clusterInitializationFailed(); } } @@ -117,7 +120,7 @@ public static void initializeNetworkSockets( ) { } catch (IOException e) { Log.trace("Cannot allocate API port " + H2O.API_PORT + " because of following exception: ", e); - if( apiSocket != null ) try { apiSocket.close(); } catch( IOException ohwell ) { Log.err(ohwell); } + if( apiSocket != null ) try { apiSocket.close(); } catch( IOException ohwell ) { Log.err(ohwell); ohwell.printStackTrace();} if( _tcpSocket != null ) try { _tcpSocket.close(); } catch( IOException ie ) { } apiSocket = null; _tcpSocket = null; @@ -130,7 +133,9 @@ public static void initializeNetworkSockets( ) { // Try next available port to bound H2O.API_PORT += (H2O.ARGS.port_offset == 1) ? 2 : 1; if (H2O.API_PORT > (1<<16)) { - Log.err("Cannot find free port for " + H2O.SELF_ADDRESS + " from baseport = " + H2O.ARGS.baseport); + String msg = "Cannot find free port for " + H2O.SELF_ADDRESS + " from baseport = " + H2O.ARGS.baseport; + Log.err(msg); + System.err.println(msg); H2O.exit(-1); } } @@ -156,8 +161,11 @@ public static void initializeNetworkSockets( ) { embeddedConfigFlatfile = ec.fetchFlatfile(); } catch (Exception e) { - Log.err("Failed to get embedded config flatfile"); + String msg = "Failed to get embedded config flatfile"; + Log.err(msg); Log.err(e); + System.err.println(msg); + e.printStackTrace(); H2O.exit(1); } } @@ -283,6 +291,7 @@ private static InetAddress getInetAddress(String ip) { addr = InetAddress.getByName(ip); } catch (UnknownHostException e) { Log.err(e); + e.printStackTrace(); H2O.exit(-1); } return addr; @@ -319,7 +328,7 @@ static private void multicast2( ByteBuffer bb, byte priority ) { // awake from sleep. if( H2O.CLOUD_MULTICAST_SOCKET != null ) try { H2O.CLOUD_MULTICAST_SOCKET.close(); } - catch( Exception e2 ) { Log.err("Got",e2); } + catch( Exception e2 ) { Log.err("Got",e2); System.err.println("Got"); e.printStackTrace();} finally { H2O.CLOUD_MULTICAST_SOCKET = null; } } }