I would like to start an OSGI framework that does not start the E4Application right away. Rather, I would like to start it later with ApplicationDescriptor.launch(...).
Currently I am running a product with
-Dosgi.noShutdown=true -Declipse.application.launchDefault=false -Declipse.allowAppRelaunch=true
and in the workbench. With these options I can start the E4Application from the console by typing
osgi> startApp org.eclipse.e4.ui.workbench.swt.E4Application
and things work as expected.
However, when I get the ApplicationDescriptor in some OSGi service and try to launch the E4Application with ApplicationDesciptor.launch(null)
I get the following exception
org.osgi.service.application.ApplicationException: The main thread is not available to launch the application: org.eclipse.e4.ui.workbench.swt.E4Application.0
What am I missing here?