public void start ( ) throws Exception { // verify server is NOT null if ( server == null ) { throw new NullPointerException ( "Internal server instance was null, server not configured perhaps?" ) ; } logger . info ( "HttpServer [{}] version [{}] using Jetty [{}]" , configuration . safeGetName ( ) , com . cloudhopper . jetty . Version . getLongVersion ( ) , server . getVersion ( ) ) ; logger . info ( "HttpServer [{}] on [{}] starting..." , configuration . safeGetName ( ) , configuration . getPortString ( ) ) ; // try to start jetty server -- if it fails, it'll actually keep running // so if an exception occurs, we'll make to stop it afterwards and rethrow the exception try { server . start ( ) ; } catch ( Exception e ) { // make sure we stop the server try { this . stop ( ) ; } catch ( Exception ex ) { } throw e ; } logger . info ( "HttpServer [{}] on [{}] started" , configuration . safeGetName ( ) , configuration . getPortString ( ) ) ; }
Starts the HTTP server . If an exception is thrown during startup Jetty usually still runs but this method will catch that and make sure it s shutdown before re - throwing the exception .