Unable to run CIF simulation in stand-alone mode using ./bin/cifsim
When running the CIF simulator in stand-alone mode using ./bin/cifsim
it crashes showing the following message:
ERROR: Failed to open editor "org.eclipse.escet.cif.simulator.input.InteractiveGuiInputEditor" for file "philosophers1.cif".
CAUSE: (IllegalStateException) Workbench has not been created yet.
Looking into the code, this error is caused by EclipseThemeUtils.isDarkThemeInUse()
as it calls PlatformUI.getWorkbench()
. Because the workbench is not active in stand-alone mode, this call fails.
Modifying the code to work around this issue revealed a second issue where the application crashes when it calls InstanceScope.INSTANCE.getNode(ThemeEngine.THEME_PLUGIN_ID)
in the EclipseThemePreferenceChangeListener
class.
The InstanceScope.INSTANCE.getNode()
functionality requires the workspace location to be specified. Again, when running in stand-alone mode this location is not specified.
Browsing the git history, it seems the introduction of "Dark theme" support broke the escet stand-alone tools ./bin/cifsim
and ./bin/cifsynthanalys
as it added dependencies to the Eclipse Workbench environment and workspace location which are not present in stand-alone mode.
See #417 More ESCET dark theme support
As suggested in, the canceled, merge request !555 (closed) I propose seperatly resolving the follwoing related issues:
-
(!557 (merged)) Resolve startup error for all eventbased stand-alone application. !555 comment -
(!558 (merged)) Adding run configuration to run/debug stand-alone CIF simulator from Eclipse. -
(!561 (merged)) Resolve error running stand-alone applications without a workspace. !555 comment -
(!561 (merged)) Resolve error checking for Dark mode by stand-alone applications. !555 comment -
(!559 (merged)) Resolve standalone cifsynthanaly closing immediately. !555 comment