Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Monday, October 04, 2004

Worst Eclipse Crash --- Ever

Somehow, after years of flawless service, my Eclipse workspace just self-destructed. Don't know what caused it, it just freaked out while I was switching between projects. My .log file says:

!SESSION Oct 04, 2004 18:44:07.894 ---------------------------------------------
eclipse.buildId=I200406251208
java.version=1.4.1_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

!ENTRY org.eclipse.osgi Oct 04, 2004 18:44:07.894
!MESSAGE An error occured while automatically activating bundle org.eclipse.core.resources (27).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start() of bun
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:975)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
        at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:110)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:371)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java:336)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java:914)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
        at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterFactory.(WorkbenchAdapterFactory.java:26)
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterBuilder.registerAdapters(WorkbenchAdapterBuilder.java:33)
        at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.initialize(IDEWorkbenchAdvisor.java:155)
        at org.eclipse.ui.application.WorkbenchAdvisor.internalBasicInitialize(WorkbenchAdvisor.java:165)
        at org.eclipse.ui.internal.Workbench.init(Workbench.java:789)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
        at org.eclipse.core.launcher.Main.run(Main.java:644)
        at org.eclipse.core.launcher.Main.main(Main.java:628)
Caused by: org.eclipse.core.internal.resources.ResourceException: The resource tree is locked for modifications.
        at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:93)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.close(Workspace.java:298)
        at org.eclipse.core.resources.ResourcesPlugin.shutdown(ResourcesPlugin.java:324)
        at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:52)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
        ... 30 more
Root exception:
org.eclipse.core.internal.resources.ResourceException: The resource tree is locked for modifications.
        at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:93)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.close(Workspace.java:298)
        at org.eclipse.core.resources.ResourcesPlugin.shutdown(ResourcesPlugin.java:324)
        at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:52)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:958)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:954)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:937)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:421)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:293)
        at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java:110)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:371)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java:336)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java:914)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
        at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterFactory.(WorkbenchAdapterFactory.java:26)
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterBuilder.registerAdapters(WorkbenchAdapterBuilder.java:33)
        at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.initialize(IDEWorkbenchAdvisor.java:155)
        at org.eclipse.ui.application.WorkbenchAdvisor.internalBasicInitialize(WorkbenchAdvisor.java:165)
        at org.eclipse.ui.internal.Workbench.init(Workbench.java:789)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
        at org.eclipse.core.launcher.Main.run(Main.java:644)
        at org.eclipse.core.launcher.Main.main(Main.java:628)

!ENTRY org.eclipse.osgi Oct 04, 2004 18:44:07.924
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IProject
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterFactory.(WorkbenchAdapterFactory.java:26)
        at org.eclipse.ui.internal.ide.model.WorkbenchAdapterBuilder.registerAdapters(WorkbenchAdapterBuilder.java:33)
        at org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.initialize(IDEWorkbenchAdvisor.java:155)
        at org.eclipse.ui.application.WorkbenchAdvisor.internalBasicInitialize(WorkbenchAdvisor.java:165)
        at org.eclipse.ui.internal.Workbench.init(Workbench.java:789)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1325)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
        at org.eclipse.core.launcher.Main.run(Main.java:644)
        at org.eclipse.core.launcher.Main.main(Main.java:628)

And that's no help.

From an hour or more of careful experimentation, I determined that deleting the file C:\workspace\.metadata\.plugins\org.eclipse.core.resources\.snap lets Eclipse start back up ... but loses all my projects. This includes my current project (no uncommitted changes) as well as my jakarta-tapestry project (yes, uncomitted changes!).

Sometimes the computer knows when you are having a bad day, and decides to make it worse!

50 comments:

Min said...

Sorry to hear that.

You can use the workspace rebuilder found here...

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/downloads.html

Steve Gibson said...

Funny...the combination of ant and GVIM have never done that to me, even back when it was vi and make ;-)

j allen said...

I found your post by googling the same exception string. My eclipse is hosed in the same way. If anyone has suggestions, please lemme know...

Jens said...

I managed to get my Eclipse to start and all projects remained.... but my "Problems" view does not quite work. Good enough for now, gotta work.

I removed my .markers file from the last project I worked with in the .metadata\.plugins\org.eclipse.core.resources\.projects [projectname] folder, that did it.

If anyone know how to restore the Problems-view...

Sven_Eu said...

I run into the same problem. Jens' solution didn't work for me, but fortunately I found another way. I deleted the files

\.metadata\.plugins\org.eclipse.core.resources\.snap
and
\.metadata\.plugins\org.eclipse.core.resources\.root\.markers.snap

and I could start eclipse with my workspace and its projects preserved properly. Everythng seems to work as it did before, also the "Problems" view.

Anonymous said...

Thanks, deleteing those files worked for me!

Anonymous said...

Thanks, deleteing those files worked for me!

Anonymous said...

You guys are awesome. I thought I was screwed.

Anonymous said...

dto - awesome hint. worked for me as well - thank you guys!!!!!!

Anonymous said...

MEGA :) thanks

Anonymous said...

Just thought I'd add another "fixed it for me too" post. Thanks!

Ceilingfish said...

Thanks sven_eu, deleting those .snap files worked for me too!

Al said...

Thanks too :) You saved my morning

Francois said...

Deleting those two files worked for me.
\.metadata\.plugins\org.eclipse.core.resources\.snap
\.metadata\.plugins\org.eclipse.core.resources\.root\.markers.snap

I had to reconfigure my project though !
Thanks a lot !

Anonymous said...

Thanks Sven. It woked for me too!

Anonymous said...

I had the same exception as you (found this site through googling the exception), but mine was caused when I was trying to build my RCP application. I deleted thos snap files and my build worked again! Thanks!

Charles Delalonde said...

Thanks guy ! You saved my day.

Charles

Daniel Amaral said...

Saved my life! Thanks!

Andre L said...

Yep, worked for me (using Radrails standalone based on Eclipse). Had to recreate my project structure, but was no big deal -- all the SVN info, modified files, etc, were right back where I left them. Thanks!

Hendrik Maryns said...

It didn’t work for me. I tried deleting those two files several times (after restoring everything from a backup, of course), but it still got me an empty workspace. I then tried to do some of jens’s stuff, which didn’t seem to do it too, but then, somehow, everything was alright again. I cannot exactly trace back what I did though. I made a diff of the old and new .metadata directory, but it seems a lot of the .marker and .snap files are gone or changed.

Anonymous said...

deleting the .snaps worked for me fine on the 3.2..

A big Thanks to you guys -

Anonymous said...

Removing .snap file worked for me as well, although eclipse launches with an empty workspace. Of course, since everything is under source control, no worries.

Anonymous said...

none of the above worked for me

however, deleting an offending .location file for a project, copying another .location file in and editing the path in the file worked.

Leonard said...

Thank you, it helped me too.
The layout was staffed but it was easy to re-import the existing projects back.
Many thankx

Troed said...

Your entry is from oct 2004. This happened to me today, august 2007. Incredible! What's even more incredible is that this happened on a fresh Eclipse installation with no workspaces so far - it has only been started once before and I was just on my way now to install Eclipse ME.

Nitz said...

Sept. 2007. Same problem (what a way to start a week). Same solution. Thanx alot.

Can anyone elaborate on the cause of the problem and what makes this solution work?

quietgenie said...

November 8th, 2007. Eclipse 3.2 under debian (aptitude install --with-recommends eclipse). Sven_Eu's solution worked for me. THANK YOU!

selvi said...

Nov 22 2007, I used sven_eu's solution and it worked for me! Thanks a lot!

Ariel said...

January 08. Same problem. I did not see any .snap files to delete and the workspace rebuilder did not fix it. I reverted to a backup copy of the workspace.

Gerald said...

deleting the .snap files worked for me as well. February 10, 2008.
Thank a bunch all. HUGE HELP!

gustavo said...

april 04 2008, works! you saved my day

haoxiang said...

Deleting those two files work! But I do have a empty project space, all you need to do is just to import them again

I had the problem because yesterday I was adding a jprofiler plugin, that caused the problem...

ben said...

2008-05-09
with Sven_Eu's fix i can now open the IDE. but all my projects have disapeared so i had to import them.

kedar said...

i deleted .markup file. this opened my eclipse however the project was messed up. I simply created a new workspace and imported all my projects with local copy. this worked for me

Artem Russakovskii said...

The suggested fix worked for me too. Thanks!

100101111 said...

Same bug :)
Is it reported to Eclipse Team?

100101111 said...

Same bug. :)
Is it reported to Eclipse Team?

Alejandro said...

Thanks, it worked for me too.

I've deleted those 2 files and now my eclipse seems to starut without many problems.

Im gonna have to import the project since they dont appear in the workspace of eclipse, but i have gained time; thanks for ur help ;)

mario said...

Fixed here as well, and no projects have been lost in the workspace.

Anurag said...

Thanks Sven_Eu
Worked out fine for me too, I thought I will have to copy the whole 5.5GB of workspace from one of my colleagues, you saved me the sweat thanks

Phill said...

In Jan 2009, this is still helpful in eclipse 3.4.0

czbird said...

Deleting those 2 files just heped me to start ClearQuest 7.1 Designer again. God bless you :)

Storm said...

God bless the internet and you. Thanks, deleting both .snap files worked fine.

Howard said...

It's amazing that over five years on, this is still one of the most popular blog postings I've written!

James Mortensen said...

What's sad is that these problems in Eclipse still persist. Every other application I run can handle a crash with minimal problems.

But not Eclipse.

Steve Gibson kind of has the right idea, VIM and ANT have never ever crashed on me. Very solid and reliable, but lacking in the debug tools provided by Eclipse.

The only problem I have with Eclipse is it being unable to handle crashing... If the Eclipse Foundation could fix these problems, it would really be a solid development platform.

James
http://blog.opensourceopportunities.com

Bob Walker said...

And lo, into 7 years, this is still an issue...
Thankfully the .snap deletion fix still works.

Daniel said...

February 2011, same problem, same solution, same result --> workspace works now, projects were gone but I was able to import them again.

Richard Köhl said...

february 2013 - same problem. workspace empty after fix.

nathan said...

september 2013
same problem
come on eclipse guys sort it out!

nathan said...

september 2013 - same problem, same fix but lost changes to a project which had a few large data files in it :/

come on eclipse sort it out!