Skip to content

Commit

Permalink
fix: run issue in system service context (#4653)
Browse files Browse the repository at this point in the history
The default service passed params where port is expected
warn and use default in case of NumberFormatException
  • Loading branch information
connoratrug authored Jan 30, 2025
1 parent 92415bc commit 19f80dc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ public class RunMolgenisEmx2 {
public static void main(String[] args) {
logger.info("Starting MOLGENIS EMX2 Software Version=" + Version.getVersion());

Integer port = 8080;
Integer port;
if (args.length >= 1) {
try {
port = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
logger.error("Port number should be an integer, but was: " + args[0]);
System.exit(1);
logger.warn("Port number should be an integer, but was: {}", args[0]);
port =
(Integer) EnvironmentProperty.getParameter(Constants.MOLGENIS_HTTP_PORT, "8080", INT);
}
} else {
port = (Integer) EnvironmentProperty.getParameter(Constants.MOLGENIS_HTTP_PORT, "8080", INT);
Expand Down

0 comments on commit 19f80dc

Please sign in to comment.