I have and osgi based application. The loading process is the following: start.sh runs not osgi loader.jar which starts felix and installs and starts bundles. By other words start.sh->loader.jar->osgi+bundles. I want to show loading process in loader.jar via javafx and I use there Application.launch(Gui.class). Everything is ok. The problem appears when in osgi bundle main program is started (also via Application.launch) and I get :
Caused by: java.lang.IllegalStateException: Application launch must not be called more than once
At stackoverflow I found the following solution how to run the second application https://stackoverflow.com/a/13439473/4568213. However, the provided solution works only if it's located "inside" javafx application, for example in start() method. If it's out it throws
Caused by: java.lang.IllegalStateException: Not on FX application thread; currentThread = main" exception.
How can I solve such problem. By other words how to get inside running javafx application and create the second stage?