Commit af5d059d authored by Romain Bioteau's avatar Romain Bioteau

Fix endless loop when tomcat fails to start

parent 0e6997c9
......@@ -176,7 +176,7 @@ public class BOSWebServerManager {
public synchronized void startServer(final IProgressMonitor monitor) {
if (!serverIsStarted()) {
BonitaHomeUtil.initBonitaHome();
copyTomcatBundleInWorkspace( monitor);
copyTomcatBundleInWorkspace(monitor);
monitor.subTask(Messages.startingWebServer);
if (BonitaStudioLog.isLoggable(IStatus.OK)) {
BonitaStudioLog.debug("Starting tomcat...",
......@@ -251,27 +251,13 @@ public class BOSWebServerManager {
}
private void waitServerRunning(final IProgressMonitor monitor) {
int totalTime = 0;
while (totalTime < MAX_SERVER_START_TIME && tomcat != null
&& tomcat.getServerState() != IServer.STATE_STARTED) {
try {
Thread.sleep(1000);
if (BonitaStudioLog.isLoggable(IStatus.OK)) {
BonitaStudioLog.debug("Tomcat server state: " + tomcat.getServerState(),
EnginePlugin.PLUGIN_ID);
}
totalTime = totalTime + 1000;
} catch (final InterruptedException e) {
BonitaStudioLog.error(e, EnginePlugin.PLUGIN_ID);
}
}
if (BonitaStudioLog.isLoggable(IStatus.OK)) {
if (tomcat.getServerState() == IServer.STATE_STARTED) {
BonitaStudioLog.debug("Tomcat server started.",
EnginePlugin.PLUGIN_ID);
} else {
BonitaStudioLog.debug("Tomcat failed to start.",
BonitaStudioLog.debug("Tomcat failed to start. Check the log file for more informations. (bonita.log or catalina.log)",
EnginePlugin.PLUGIN_ID);
if (!PlatformUtil.isHeadless()) {
Display.getDefault().syncExec(new Runnable() {
@Override
......@@ -282,8 +268,8 @@ public class BOSWebServerManager {
Messages.cannotStartTomcatMessage);
}
});
return;
}
return;
}
connectWithRetries();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment