diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java index 56a3f2e63..ddc8187e4 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/java/org/deeplearning4j/ui/VertxUIServer.java @@ -369,7 +369,7 @@ public class VertxUIServer extends AbstractVerticle implements UIServer { //Check port property int port = instancePort == null ? DEFAULT_UI_PORT : instancePort; - String portProp = System.getenv(DL4JSystemProperties.UI_SERVER_PORT_PROPERTY); + String portProp = System.getProperty(DL4JSystemProperties.UI_SERVER_PORT_PROPERTY); if(portProp != null && !portProp.isEmpty()){ try{ port = Integer.parseInt(portProp); @@ -378,6 +378,10 @@ public class VertxUIServer extends AbstractVerticle implements UIServer { } } + if (port < 0 || port > 0xFFFF) { + throw new IllegalStateException("Valid port range is 0 <= port <= 65535. The given port was " + port); + } + uiEventRoutingThread = new Thread(new StatsEventRouterRunnable()); uiEventRoutingThread.setDaemon(true); uiEventRoutingThread.start();