|Display not available when plugin starts() [message #1048512]
||Wed, 24 April 2013 15:19
| Laurent Petit
Registered: December 2010
tl;dr: is it ok (as in technically possible, not as in 'recommanded or not recommanded') for a start() method of an UI plugin to call Display.asyncExec(new Runnable()) ?|
My plugin is a UI plugin (extends AbstractUIPlugin, FWIW).
It declares a Builder, and also a classpath container, among other things.
It also happens to have Preferences, extending AbstractPreferenceInitializer, using method initializeDefaultPreferences(), and declared via plugin.xml.
Recently, lots of users have reported problems for restarting their Eclipse, especially after a crash (be it unwanted, or provoked by them because Eclipse became unresponsive).
(I can now easily reproduce the situation by force-crashing my target platform, and then restarting).
What I see is that my plugin is started early on by the OSGi platform.
And since my Preferences depend on some JDT preferences, at some point there is a null pointer exception, because JDT preferences try to get some JFace PreferenceConverter, which in turn tries to get the Display.
But the display is not even created yet, and my plugin - and more than often the entire Eclipse - refuses to start.
Thanks in advance,
Powered by FUDForum
. Page generated in 0.02400 seconds