// the following loop is a 'fake' progress monitoring where the progress
// bar is advanced by one unit every second until maxUnits -2
- while(!CdmStore.getManagedServer().isStarted()) {
+ while(!CdmStore.getManagedServer().isStarted() && !CdmStore.getManagedServer().isFailed()) {
if(serverUnits < maxUnits - 2) {
try {
Thread.sleep(1000);
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
- hide(false);
- updateManagedServerControls();
- connect();
- }
+ hide(false);
+ updateManagedServerControls();
+ connect();
+ }
});
} catch (IOException ioe) {
MessagingUtils.errorDialog("Error generating server config file",
WebAppContext webapp = new WebAppContext();
webapp.setContextPath(contextPath);
webapp.setWar(warFile.getAbsolutePath());
+ webapp.setThrowUnavailableOnStartupException(true);
server.setHandler(webapp);
}
server.start();
server.join();
} catch (Throwable t) {
- cdmServerError.handleError(t);
+ //wait for 1sec to get the right order of login dialog and error
+ //message when connection fails
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ cdmServerError.handleError(new RuntimeException("Error during CDM server startup", t));
}
}
};
return server.isStarted();
}
+ public boolean isFailed() {
+ return server.isFailed();
+ }
+
public void stop() throws Exception {
server.stop();
server.destroy();