diff --git a/serving/src/main/java/ai/djl/serving/util/Connector.java b/serving/src/main/java/ai/djl/serving/util/Connector.java index eb181d08b01..12fe0a5027b 100644 --- a/serving/src/main/java/ai/djl/serving/util/Connector.java +++ b/serving/src/main/java/ai/djl/serving/util/Connector.java @@ -105,7 +105,7 @@ public static Connector parse(String binding, ConnectorType connectorType) { } else { port = Integer.parseInt(listeningPort); } - if (port >= Short.MAX_VALUE) { + if (port >= 65535) { throw new IllegalArgumentException("Invalid port number: " + binding); } return new Connector(port, false, host, String.valueOf(port), ssl, connectorType);