aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java7
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java2
2 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java b/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java
index 50239fe282d..80f444dd6de 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/app/EmbeddedTomcat.java
@@ -70,9 +70,10 @@ class EmbeddedTomcat {
tomcat.getServer().await();
} catch (Exception e) {
throw new IllegalStateException("Fail to start web server", e);
+ } finally {
+ // Shutdown command received
+ stop();
}
- // Shutdown command received
- stop();
}
private File tomcatBasedir() {
@@ -120,7 +121,7 @@ class EmbeddedTomcat {
}
boolean isReady() {
- return ready;
+ return ready && tomcat != null;
}
int port() {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java b/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java
index 0c615c531cb..c6b7d2f6346 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java
@@ -49,7 +49,7 @@ public final class PlatformServletContextListener implements ServletContextListe
// unexpected errors
LoggerFactory.getLogger(getClass()).error("Fail to start server", t);
stopQuietly();
- System.exit(1);
+ throw new IllegalStateException("Fail to start server", t);
}
}