Revision f4335b0e
Added by Patrick Plitzner almost 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java | ||
---|---|---|
735 | 735 |
|
736 | 736 |
// the following loop is a 'fake' progress monitoring where the progress |
737 | 737 |
// bar is advanced by one unit every second until maxUnits -2 |
738 |
while(!CdmStore.getManagedServer().isStarted()) { |
|
738 |
while(!CdmStore.getManagedServer().isStarted() && !CdmStore.getManagedServer().isFailed()) {
|
|
739 | 739 |
if(serverUnits < maxUnits - 2) { |
740 | 740 |
try { |
741 | 741 |
Thread.sleep(1000); |
... | ... | |
748 | 748 |
Display.getDefault().asyncExec(new Runnable() { |
749 | 749 |
@Override |
750 | 750 |
public void run() { |
751 |
hide(false); |
|
752 |
updateManagedServerControls(); |
|
753 |
connect(); |
|
754 |
} |
|
751 |
hide(false);
|
|
752 |
updateManagedServerControls();
|
|
753 |
connect();
|
|
754 |
}
|
|
755 | 755 |
}); |
756 | 756 |
} catch (IOException ioe) { |
757 | 757 |
MessagingUtils.errorDialog("Error generating server config file", |
eu.etaxonomy.taxeditor.webapp/src/main/java/eu/etaxonomy/taxeditor/webapp/CDMServer.java | ||
---|---|---|
106 | 106 |
WebAppContext webapp = new WebAppContext(); |
107 | 107 |
webapp.setContextPath(contextPath); |
108 | 108 |
webapp.setWar(warFile.getAbsolutePath()); |
109 |
webapp.setThrowUnavailableOnStartupException(true); |
|
109 | 110 |
|
110 | 111 |
server.setHandler(webapp); |
111 | 112 |
} |
... | ... | |
183 | 184 |
server.start(); |
184 | 185 |
server.join(); |
185 | 186 |
} catch (Throwable t) { |
186 |
cdmServerError.handleError(t); |
|
187 |
//wait for 1sec to get the right order of login dialog and error |
|
188 |
//message when connection fails |
|
189 |
try { |
|
190 |
Thread.sleep(1000); |
|
191 |
} catch (InterruptedException e) { |
|
192 |
} |
|
193 |
cdmServerError.handleError(new RuntimeException("Error during CDM server startup", t)); |
|
187 | 194 |
} |
188 | 195 |
} |
189 | 196 |
}; |
... | ... | |
204 | 211 |
return server.isStarted(); |
205 | 212 |
} |
206 | 213 |
|
214 |
public boolean isFailed() { |
|
215 |
return server.isFailed(); |
|
216 |
} |
|
217 |
|
|
207 | 218 |
public void stop() throws Exception { |
208 | 219 |
server.stop(); |
209 | 220 |
server.destroy(); |
Also available in: Unified diff
Throw exception when server startup fails #5812