Unhandled event loop exception

Lot of people wonder what the famous Unhandled event loop exception is !!!???

This is no more than an uncaught Exception occurring with in the Eclipse workbench Main thread (or the UI thread, it’s the same).

When writing Eclipse plugins we often write code that will be executed within the Main thread. For example when contributing a new hello world button within the main Eclipse toolbar we must implement a given interface with a run() method.

In this method we write the code responsible to display to the user the “Hello world message”. If this code throws a new Exception without catching it then the Exception is forwarded to the caller. This caller is the Eclipse code but not our !!!!

In this Eclipse code the Exception is forwarded up to the Workbench.runEventLoop(IExceptionHandler, Display) method that catch it and log a new Unhandled event loop exception Error message. This message also contains our source Exception displayed as Reason :

When you see an Unhandled event loop exception , don’t worry and just look for the reason, it’s often a silly mistake :o )

6 Responses to “Unhandled event loop exception”

  1. Stuart Says:

    This is happening for me constantly and I’m not a plugin developer

    It just started happening today and I can’t get it to stop it’s making the PHPEclipse UI unusable!!

    Any ideas anyone? I’ve disabled the php project builder and the validation but no help

    It happening in Processing Dirty Regions whatever that is!

    Thanks

  2. Stuart Says:

    Here’s the error log:

    Unhandled event loop exception
    java.lang.StackOverflowError

  3. milo Says:

    Hi,

    I had a similar problem with Eclipse PDT 1.0.2 on Mac and I deleted the file (.php), which caused the error and created it again. After that the error did not pop up again.

    Perhaps it helps for you or someone.

  4. Manuel Says:

    It seems you didn’t read my post until the end ;o). The Unhandled event loop exception is not a real Exception, but an Exception created by the SWT UI main thread containing a real Exception.

    For Stuart the exception is StackOverflow which often means that you have an infinite (or too deep) recursive function.

    For Milo, just look for the Exception contained in your Unhandled event loop exception and may be you’ll understand why deleting the .php file fixed the problem.

    Hope this help

    Manu

  5. Rahul Says:

    Hi,
    I get the same exception when I try to open a XML file (e.g web.xml) in Eclipse. Note that I do not get this exception for every xml file and I have added no code so far that has any loop.As suggested above, I saw the log file of eclipse but there is no real exception shown at the end of stack trace.

    One more thing, if I restart my windows, this exception disappears and I can open the xml file but at random this exception starts occuring when I try to open a xml document.

    Pls help

    Regards,
    Rahul

  6. sabri Says:

    I am facing same exception with Eclipse with Crsytal Reports plugin during the adding tables from a remote IBM DB2 database but there is no problem with local MS SQL database.

Leave a Reply