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

Bug 536894

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.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, stephane.begaudeau
Version: 6.0.0   
Target Milestone: 6.0.1   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/125930
https://git.eclipse.org/r/125972
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2fafdbc3e7b695422b8919f735cf73013ce0e877
Whiteboard:
Bug Depends on:    
Bug Blocks: 536066, 538329    

Description Pierre-Charles David CLA 2018-07-11 02:45:15 EDT
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 Eclipse Genie CLA 2018-07-11 11:04:35 EDT
New Gerrit change created: https://git.eclipse.org/r/125930
Comment 2 Eclipse Genie CLA 2018-07-12 06:53:37 EDT
New Gerrit change created: https://git.eclipse.org/r/125972
Comment 4 Pierre-Charles David CLA 2018-07-20 08:47:11 EDT
Fixed by:
* ca6a45848e3d6eb26f4a5bd3acc10cf5e74f2e4c for v6.0.x (6.0.1)
* 2fafdbc3e7b695422b8919f735cf73013ce0e877 for master (6.1.0)
Comment 5 Florian Barbin CLA 2018-08-03 05:07:09 EDT
Validated as technical issue
Comment 6 Pierre-Charles David CLA 2018-08-27 04:13:50 EDT
Available in Sirius 6.0.1, see https://wiki.eclipse.org/Sirius/6.0.1 for details.