jetty.project
jetty.project copied to clipboard
Possible NullPointerException in Main.java when stopped from command line
When Jetty is started from the command line (i.e. via the main method), the member jsvcStartArgs in org.eclipse.jetty.start.Main is not initialized. Unfortunately, inside the stop() method, this member's methods are accessed without null check here and here!
This results in a NullPointerException when a SocketTimeoutException or a ConnectException occurs during stop(). The NPE is logged, but the original exception is lost.
Jetty 9.4.5.v20170502 is stopping...
java.lang.NullPointerException
at org.eclipse.jetty.start.Main.stop(Main.java:613)
at org.eclipse.jetty.start.Main.stop(Main.java:553)
at org.eclipse.jetty.start.Main.doStop(Main.java:541)
at org.eclipse.jetty.start.Main.start(Main.java:417)
at org.eclipse.jetty.start.Main.main(Main.java:78)
Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs]
java -jar $JETTY_HOME/start.jar --help # for more information
Expected behavior:
The member jsvcStartArgs should be initialized properly or the exception handlers should perform a null check before accessing its methods.
Thanks for the report. a fix has been pushed.