Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 538329

Summary: The server autostart feature should be marked experimental and depend on the server itself
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: ServerAssignee: Project Inbox <sirius.server-inbox>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, sirius.core-inbox, stephane.begaudeau
Version: 6.0.0   
Target Milestone: 6.1.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 536894    
Bug Blocks: 536066    

Description Pierre-Charles David CLA 2018-08-28 05:10:41 EDT
+++ This bug was initially created as a clone of Bug #536894 +++

Stack tacken from https://www.eclipse.org/forums/index.php/mv/msg/1094159/1792076/#msg_1792076:

!ENTRY org.eclipse.ui 4 0 2018-07-10 17:58:27.383
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.sirius.server.ui.autostart.internal.SiriusServerStartup.lambda$2(SiriusServerStartup.java:98)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3906)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3537)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)

The code in question does:

	Bundle siriusServerBundle = Platform.getBundle(SIRIUS_SERVER_PLUGIN_ID);
	if (siriusServerBundle.getState() != Bundle.ACTIVE) { // <== NPE here

Two issues:
* The server auto-start feature and plug-ins do not depend on the server itself, so it is possible to have the auto-start plug-in installed without the server, which triggers the NPE.
* The auto-start feature's description does not clearly mark it as experimental, so users may want to install it "just to see", and then get the NPE.
Comment 1 Pierre-Charles David CLA 2018-08-28 05:11:06 EDT
Clone to report the fix on master for 6.1.
Comment 2 Pierre-Charles David CLA 2018-08-28 05:13:27 EDT
Fixed by:
- 2fafdbc3e7b695422b8919f735cf73013ce0e877
- 0120abcabb6b1baed3dfc96ebf3fb1bb59f3073b
Comment 3 Pierre-Charles David CLA 2018-09-24 02:53:59 EDT
Steps to reproduce: from a "basic" Sirius installation, point to the update-site corresponding to the running version.
1. Find the "Server Autostart" feature: it's title/label should clearly indicate that it is experimental.
2. Install the feature *and only this feature*, restart, and verify that the "Server" feature has been installed as a dependency.
Comment 4 Pierre-Charles David CLA 2018-10-19 12:48:48 EDT
Available in Sirius 6.1.0, see https://wiki.eclipse.org/Sirius/6.1.0