- display = Display.getDefault();
- display.setRuntimeExceptionHandler((e) -> e.printStackTrace());
- display.setErrorHandler((e) -> e.printStackTrace());
-
-// for (String contextName : cmsApps.keySet()) {
-// openCmsApp(contextName);
-// }
-
- while (!shutdown) {
- if (!display.readAndDispatch())
- display.sleep();
+ try {
+ display = Display.getDefault();
+ display.setRuntimeExceptionHandler((e) -> e.printStackTrace());
+ display.setErrorHandler((e) -> e.printStackTrace());
+
+ while (!shutdown) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ display = null;
+ } catch (UnsatisfiedLinkError e) {
+ logger.log(Level.ERROR,
+ "Cannot load SWT, probably because the OSGi framework has been refresh. Restart the application.",
+ e);