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)

Advertisements

16 thoughts on “Unhandled event loop exception

  1. 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. 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.

  3. 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

  4. 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

  5. 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.

  6. Getting same error, just trying to open a simple PHP file in Eclipse. Eclipse sucks, I’m going back to Emacs for now.

  7. Can you just let me know why the event loop exception is occuring when execution environment finishesh execution of addPages() method. Code is given below..

    package wizard;
    import org.eclipse.core.resources.IFile;
    import java.util.Vector;
    import org.eclipse.jface.viewers.IStructuredSelection;
    import org.eclipse.jface.wizard.Wizard;
    import org.eclipse.ui.INewWizard;
    import org.eclipse.ui.IWorkbench;
    import org.eclipse.ui.IWorkbenchPage;
    import org.eclipse.ui.PlatformUI;
    import java.io.File;
    import org.eclipse.core.filesystem.EFS;
    import org.eclipse.core.filesystem.IFileStore;
    import org.eclipse.ui.ide.IDE;

    public class AspectEditorWizard extends Wizard implements INewWizard{
    AEProject aePage;
    Browse browsePage;
    SelectProcesses selectProcess;
    public static boolean wizflag=false;
    public static boolean flag=false;
    public static String selected=null;
    public static Vector filenames=new Vector();
    public static int filecount;
    IWorkbenchPage page;
    IFile file;
    protected IStructuredSelection selection;
    protected IWorkbench workbench;

    public AspectEditorWizard() {
    super();
    }

    public void addPages(){
    aePage = new AEProject(workbench, selection);
    addPage(aePage);
    browsePage=new Browse(“Page2”);
    addPage(browsePage);
    selectProcess=new SelectProcesses(“Page3″);
    addPage(selectProcess);
    }
    public void init(IWorkbench workbench, IStructuredSelection selection) {
    this.workbench = workbench;
    this.selection = selection;
    }

    public boolean canFinish(){
    return true;
    }

    public boolean performFinish() {
    /*
    final String s1=”\\\\”;
    final String s2=”/”;
    try{
    selected=selected.replaceAll(s1, s2);
    b.setMessage(selected);
    b.open();
    }
    catch(Exception e){
    System.out.println(e);
    }
    File f=new File(selected);
    if(f.exists() && f.isFile()){
    IFileStore filestore=EFS.getLocalFileSystem().getStore(f.toURI());
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try{
    IDE.openEditorOnFileStore(page, filestore);
    }
    catch(Exception e){

    }
    }*/
    return true;
    }
    }

  8. The same thing happened to me, and I had to dig a lot before I found a solution. In my styles.xml I had an entry where the name and parent attributes were identical:

    @drawable/header_background

    By removing the parent attribute the layout editor finally worked again:

    @drawable/header_background

  9. The same thing happened to me, and I had to dig a lot before I found a solution. In my styles.xml I had an entry where the name and parent attributes were identical:

    /*
    @drawable/header_background

    */

    By removing the parent attribute the layout editor finally worked again:

    /*
    @drawable/header_background

    */

  10. My error only occurs when I use the Download Libraries button. I’m pretty sure that it worked fine until I installed a jboss plug-in. It seems to be a stackoverflow problem as well, but I have no clue where to even start looking for a solution to this situation.

  11. I was getting it when trying to print the contents of a relatively large HashMap (total of 4mb worth of data) to the system console. I guess it blew out the console buffer or something. Not the most helpful error message, though.

  12. i am getting this error contineously ,
    unhandled event loop exception
    java.lang.NullPointerException
    at org.eclipse.ant.internal.ui.AntUtil.isKnownAntFile(AntUtil.java:594)
    at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut.launch(AntLaunchShortcut.java:466)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:424)
    at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launchShortcut(ContextRunner.java:217)
    at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.showShortcutSelectionDialog(ContextRunner.java:286)
    at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.selectAndLaunch(ContextRunner.java:140)
    at org.eclipse.debug.internal.ui.contextlaunching.ContextRunner.launch(ContextRunner.java:82)
    at org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction.run(AbstractLaunchToolbarAction.java:79)
    at org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction.runWithEvent(AbstractLaunchHistoryAction.java:404)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:241)
    at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s