Eclipse loading problem : XPCOM error

November 3, 2008

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(Mozilla.java:1360)
at org.eclipse.swt.browser.Mozilla.setText(Mozilla.java:1564)
at org.eclipse.swt.browser.Browser.setText(Browser.java:716)
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.setInput(JavadocView.java:531)
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.refresh(JavadocView.java:452)
at org.eclipse.jdt.internal.ui.infoviews.JavadocView.setBackground(JavadocView.java:439)
at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView.inititalizeColors(AbstractInfoView.java:327)
at org.eclipse.jdt.internal.ui.infoviews.AbstractInfoView.createPartControl(AbstractInfoView.java:191)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:372)
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.

Answering the most hardest questions

July 28, 2011

1. How to understand women?
- Still being calculated. Says it will take more time than it took to find the answer “42″.
2. What is love?
- sacrifice (answer tested & verified)

ඉර පායාපන්

July 17, 2011

වැහි දෙවිඳුනි අප දෙස බලාපන්
වැටෙන වැටෙන වැහි අතුගා දමාපන්
අඳුරු වලා නිල් අහසෙන් මකාපන්
හිරු දෙවිඳුනි ඇස් ඇරලා බලාපන්

මල්ලීයි මමයි අකුරට යන වෙලාවේ

July 17, 2011

මල්ලීයි මමයි අකුරට යන වෙලාවේ
කලු කරගෙන ආවා වැහි වලාවේ
මුවා වෙන්න ගසකුත් නැති වෙලාවේ
පමා වෙලා වැහැපන් වැහි වළාවේ

මගේ කලණ මිතුරා

June 20, 2011

නොනිමි පිපාසෙට වැලි ගිල දමනා මිරිඟු කරා ඇදි දන පරයා
පය මත දැවටෙන පිනි තැවරුනු තණ මෙන් මා මන නැවුම් සිසිලෙන් නැහැවූ මා මිතුර
සසර පුරා ඔබ මට හමුවෙවා…

The most embarrassing day of my life

May 31, 2011

and you thought I was going to blog about it huh? :P

Sri Lankan Bus Conductors

May 31, 2011

My default understanding of bus conductors in SL is that a very few have manners or “pleasantness”. And almost none having both.

I know in some bus routes the correct balance is returned only if he is in a good mood enough to not to be greedy. 120 route from pettah to kesbewa is not such a bus route (thank you god) but a conductors never miss an opportunity give less balance when he can  justify it. In most such cases we have to remember when we are getting off the bus to ask the conductor to give the remaining balance.

 

On one such rare situation last week (28.05.2011) when I had forgotten to do so, this conductor came from the other end of the bus to the rear end & handed over the balance. It was a day to remember.

My first visit to a Kovil

May 3, 2011

I don’t believe I’ve ever gone to a “kovil”…… until today morning. I didn’t expect much when I went there, but once I got there, despite my disbelief in belief of my fate is in a gods hand, it was a really remarkable scene.

With the blazing trumpet & the drums (dont know what their exact names) stood at the end of the corridor a statue of god “Vishnu” in a well lit room. This cloths statue was gleaming (most probably it may have being washed in milk in the morning) with showered flowers everywhere. The priest, very active, was making his voice heard over to the other end of the 30 meter corridor which all the followers enter the kovil. Couldn’t get much close to have a better look, but the fragrances that wafted from burning many powders (kunkuma etc.) & burning oil etc takes you to a feeling of a totally different trance. It was truly a remarkable experience. It was also a proud moment for me where I could point and say that this was part of my culture.

Ghosts of past…

April 29, 2011

Have you ever had this utmost sad feeling when you suddenly, unexpectedly see someone (even from a picture) whom you’ve lost forever? I just had that a few minutes ago. and not for the first time either.

But this time it was a little different. This time I realized for the first time that I was sad not because of loosing the person, but because I was in an illusion of really having the person. I’m not going to pour my life & soul to this blog, but long story short, I was fooled to believe that this particular person was really being a friend of mine while in reality she was using me. (yep I’m talking about a “she”).

This was years ago back while I was in uni. But the experience still haunts me (may b the correct word could be “devastating”). Once something like that happens turning a new leaf is like trying to create a Frankenstein monster  and bring it to life. Once you bring it to life it’ll still be a miserable looking walking talking corpse (with all the rattling, clanking tin cans & all) having a beating heart which no one gets why the damn thing doesn’t pump blood.

So one short advice if anyone is reading this crazy post. When all hell breaks loose in your heart, just then & there, let it go. Don’t let the ghosts follow with you to the future. Trust me, you really don’t want that.

Starting back my blog…

April 29, 2011

Feels like I should start blogging again. Don’t know why, but it feels right all of a sudden. So here we go….

ලෝකය මඩ ගොහොරුවකි. අපි සැම එහි මී හරකුන් වෙමු.

February 2, 2011

Follow

Get every new post delivered to your Inbox.