if (startupContext == null) {
displaySplashScreen(rootApplicationContext);
}
final Application application;
try {
application = (Application) rootApplicationContext.getBean(APPLICATION_BEAN_ID, Application.class);
} catch (NoSuchBeanDefinitionException e) {
throw new IllegalArgumentException(
"A single bean definition with id " + APPLICATION_BEAN_ID + ", of type " + Application.class.getName() + " must be defined in the main application context",
e);
}
try {
// To avoid deadlocks when events fire during initialization of some swing components
// Possible to do: in theory not a single Swing component should be created (=modified) in the launcher thread...
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
application.start();
}
});
} catch (InterruptedException e) {
logger.warn("Application start interrupted", e);
} catch (InvocationTargetException e) {