Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Display not available when plugin starts()
Display not available when plugin starts() [message #1048512] Wed, 24 April 2013 15:19 Go to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
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()) ?

Hello,

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,

-- Laurent
Re: Display not available when plugin starts() [message #1049001 is a reply to message #1048512] Thu, 25 April 2013 08:12 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

Try the plug-in forums as this is not Eclipse 4 specific.
Re: Display not available when plugin starts() [message #1049004 is a reply to message #1049001] Thu, 25 April 2013 08:16 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
Hello,

Or is it ?

I mean, there may be some problem with the Compatibility layer with Eclipse 3 ?

I will follow your suggestion anyway, and cross post to the plug-in forums, thanks.
Re: Display not available when plugin starts() [message #1049006 is a reply to message #1049004] Thu, 25 April 2013 08:20 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

Easy to confirm. Grab Indigo (or 3.Cool and try it there. If it works there and not on 4.x, it's possibly compat's layer issue.
Re: Display not available when plugin starts() [message #1049009 is a reply to message #1049006] Thu, 25 April 2013 08:22 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
Sure enough. I've circled around this issue for too long now, and forgot the basics. I will do this and get back here if there is more evidence of it.
Re: Display not available when plugin starts() [message #1049010 is a reply to message #1049006] Thu, 25 April 2013 08:22 Go to previous message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

Cool -> 8 )
Previous Topic:Changing MenuItem Text when contributed via plugin.xml in 3.8.1 (4.2.1)
Next Topic:Questions about migrating from 3.5 to 4.3
Goto Forum:
  


Current Time: Fri Dec 19 16:33:59 GMT 2014

Powered by FUDForum. Page generated in 0.11792 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software