File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
java/com/marklogic/quickstart Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,9 @@ public void contextLoaded(ConfigurableApplicationContext context) {}
2929 @ Override
3030 public void finished (ConfigurableApplicationContext context , Throwable exception ) {
3131 String port = context .getEnvironment ().getProperty ("local.server.port" );
32- System .out .println ("QuickStart UI Ready and Listening on port " + port );
33- System .out .println ("http://localhost:" + port );
32+ if (exception == null ) {
33+ System .out .println ("QuickStart UI is Ready and Listening on port " + port + ".\n " );
34+ System .out .println ("Open your browser to http://localhost:" + port + ".\t (We recommend you use Chrome or FireFox.)" );
35+ }
3436 }
3537}
Original file line number Diff line number Diff line change 1+ package com .marklogic .quickstart ;
2+
3+ import org .springframework .boot .context .embedded .tomcat .ConnectorStartFailedException ;
4+ import org .springframework .boot .diagnostics .AbstractFailureAnalyzer ;
5+ import org .springframework .boot .diagnostics .FailureAnalysis ;
6+
7+ public class PortInUseFailureAnalyzer extends AbstractFailureAnalyzer <ConnectorStartFailedException > {
8+ @ Override
9+ protected FailureAnalysis analyze (Throwable rootFailure ,
10+ ConnectorStartFailedException cause ) {
11+ return new FailureAnalysis (
12+ "QuickStart failed to start because port " + cause .getPort ()
13+ + " is already being used." ,
14+ "Try running with a different port:\n "
15+ + "java -jar quickstart.war --server.port=8080\t \t (replace 8080 with your desired port)" ,
16+ cause );
17+ }
18+ }
Original file line number Diff line number Diff line change 1- org.springframework.boot.SpringApplicationRunListener=com.marklogic.quickstart.ApplicationRunListener
1+ # Run Liseners
2+ org.springframework.boot.SpringApplicationRunListener=\
3+ com.marklogic.quickstart.ApplicationRunListener
4+
5+ # Failure Analyzers
6+ org.springframework.boot.diagnostics.FailureAnalyzer=\
7+ com.marklogic.quickstart.PortInUseFailureAnalyzer
You can’t perform that action at this time.
0 commit comments