aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-07-29 10:12:08 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-07-29 10:12:08 +0200
commitf15a89411cb226cb35b5100f1626c2812cbcdeae (patch)
tree3fcabfa5e6bd9fc260c1eaed05d082029f5236c7 /server
parenta570bd8448809fd4cf4ef9a86dfdd2dfcce33e6d (diff)
downloadsonarqube-f15a89411cb226cb35b5100f1626c2812cbcdeae.tar.gz
sonarqube-f15a89411cb226cb35b5100f1626c2812cbcdeae.zip
SONAR-4898 - Fixed rogue TC when SQ plateform fails to load.
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);
}
}