Eclipse loading problem : XPCOM error

If you are an eclipse user you may have come across this error atleast once in you lifetime. Sometimes this error shown as a message “Widget disposed too early” or something like that. To be more precise when starting eclipse it just hands on a small blank dialog kind of form after specifying the workspace. You cannot close or exit from this form. It just hangs.

This happens mostly in linux. I experienced this in ubuntu hardy with Ganymede mostly. If this happenes first thing you should do it to verify the problem. Just check the log for the workspace to see what the exception thrown before eclipse hanged. For example in our case it will be something like this.

Exception in thread “Thread-1” org.eclipse.

swt.SWTError: XPCOM error -2147467262
at org.eclipse.swt.browser.Mozilla.error(
at org.eclipse.swt.browser.Mozilla.setText(
at org.eclipse.swt.browser.Browser.setText(
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.setInput(
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.refresh(
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.setBackground(
at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView.inititalizeColors(
at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView.createPartControl(
at org.eclipse.ui.internal.ViewReference.createPartHelper(
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.j……


Now for the solution.

Well the solution is a bit murkey. I came across the worst path of solving the problem with the only solution available. Eclipse uses XUL (spelled “zool”) for its GUI rendering when in linux. This is kind of weird because the actually reason i figured out is that it uses the platform current browser to do that for him. This in the case of linux where the default browser is most of the time is Mozilla Firefox, eclipse uses the functionalities of firefox to render its GUI. If in the case of windows it uses IE as I can remember. This is why the above exception contains the words like “browser” “mozilla” etc.

Anyway the problem occures due to a simple reason, the firefox browser does the rendering using the xulrunner. There is a default xulrunner when firefox is installed and this version is not updated enough for eclipse. Thus it cannot render the UI parts and the UI widgets are disposed not being able to be created correctly. So the easy solution is to update the xulrunner.

You can do a simple

$apt-get update xulrunner or $apt-get install xulrunner

Works most of the time. But sometimes its best to do a system wide upgrade using

$apt-get upgrade

because there is a version firefox which xulrunner also supports, and if the firefox is old (or in 3.0beta for eaxmple), the xulrunner will not get updated properly.

So after that the eclipse should work fine. But mind you, you might want to start on a fresh workspace anyway.

But i have seem in some instances where eclipse can start on a already created (and previously worked) workspaces. Yeah i know, WIERD!!!

Well In my case this worked great on eclipse, but with a hitch. The firefox was giving trouble now. The address bar not working properly, icons in the title bar disabled, No history or bookmarks shown etc. It looked like the upgrade messed up the firefox.

With a little bit of searching I found that this can happen if the firefox profile gets corrupted. For those of you who does not know what a firefox profile is, its just a simple profiles created by the firefox to keep track of each and every uses preferences/history/bookmarks/etc etc.

So all you have to do is to create a new firefox profile abadoning the one you already have. Google for how to create a new profile. For those of who wants to keep the old one all they have to do is to go and rename the “localstore.rdf” file to say “localstore.rdf.tmp” and restart the browser. (This file is normally located in “~/.mozilla/firefox/<somefolder_for_the_profile>/localstore.rdf”).

localstore.rdf is the file where most of the settings of the profile are declared. When this file is missing the browser automatically resets the settings for the browser. And you will see that the buttons and icons etc will start working normally again 🙂

but make sure u rename the “localstore.rdf.tmp” back to “localstore.rdf” after the browser resets the settings. Because if not eclipse again will start giving problems and this time it will not be specific on what the problem is. It will not even mention that the problem is with the profile of the browser. It will just not behavie as you expect and make you think there is something wrong in you code (because most of the time it doesn’t throw an exception also). In my case this happened to me. Where i was not able to add a dynamic project to the tomcat server as the runtime environment. We can add the dynamic projects to run with the tomcat server from the left list box to right list box (if u can remember). Both the list boxes will just remain empty. And there will be no hint on whats exactly wrong. So i restored the localstore.rdf file and it started working again.

Hope this helped anyone. Dont want someone else to waste a day to solve this problem.


Tags: , , , , , ,

One Response to “Eclipse loading problem : XPCOM error”

  1. Ian Says:

    Thank you very much for this article. I had this problem after installing Eclipse on CentOS 5.2. It was my first time trying Eclipse and, as I couldn’t find an installation guide, I was just guessing what to do. Had it not been for your article I would have assumed I had installed it incorrectly and probably given up on Eclipse due to lack of documentation. It still lacks documentation, but at least it is working now…

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: