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!
Thanks, deleteing those files worked for me!
ReplyDeleteThanks, deleteing those files worked for me!
ReplyDeleteYou guys are awesome. I thought I was screwed.
ReplyDeletedto - awesome hint. worked for me as well - thank you guys!!!!!!
ReplyDeleteMEGA :) thanks
ReplyDeleteJust thought I'd add another "fixed it for me too" post. Thanks!
ReplyDeleteThanks sven_eu, deleting those .snap files worked for me too!
ReplyDeleteThanks too :) You saved my morning
ReplyDeleteDeleting those two files worked for me.
ReplyDelete\.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 !
Thanks Sven. It woked for me too!
ReplyDeleteI 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!
ReplyDeleteThanks guy ! You saved my day.
ReplyDeleteCharles
Saved my life! Thanks!
ReplyDeleteYep, 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!
ReplyDeleteIt 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.
ReplyDeletedeleting the .snaps worked for me fine on the 3.2..
ReplyDeleteA big Thanks to you guys -
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.
ReplyDeletenone of the above worked for me
ReplyDeletehowever, deleting an offending .location file for a project, copying another .location file in and editing the path in the file worked.
Thank you, it helped me too.
ReplyDeleteThe layout was staffed but it was easy to re-import the existing projects back.
Many thankx
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.
ReplyDeleteSept. 2007. Same problem (what a way to start a week). Same solution. Thanx alot.
ReplyDeleteCan anyone elaborate on the cause of the problem and what makes this solution work?
November 8th, 2007. Eclipse 3.2 under debian (aptitude install --with-recommends eclipse). Sven_Eu's solution worked for me. THANK YOU!
ReplyDeleteNov 22 2007, I used sven_eu's solution and it worked for me! Thanks a lot!
ReplyDeleteJanuary 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.
ReplyDeletedeleting the .snap files worked for me as well. February 10, 2008.
ReplyDeleteThank a bunch all. HUGE HELP!
april 04 2008, works! you saved my day
ReplyDeleteDeleting those two files work! But I do have a empty project space, all you need to do is just to import them again
ReplyDeleteI had the problem because yesterday I was adding a jprofiler plugin, that caused the problem...
2008-05-09
ReplyDeletewith Sven_Eu's fix i can now open the IDE. but all my projects have disapeared so i had to import them.
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
ReplyDeleteThe suggested fix worked for me too. Thanks!
ReplyDeleteSame bug :)
ReplyDeleteIs it reported to Eclipse Team?
Same bug. :)
ReplyDeleteIs it reported to Eclipse Team?
Thanks, it worked for me too.
ReplyDeleteI'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 ;)
Fixed here as well, and no projects have been lost in the workspace.
ReplyDeleteThanks Sven_Eu
ReplyDeleteWorked 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
In Jan 2009, this is still helpful in eclipse 3.4.0
ReplyDeleteDeleting those 2 files just heped me to start ClearQuest 7.1 Designer again. God bless you :)
ReplyDeleteGod bless the internet and you. Thanks, deleting both .snap files worked fine.
ReplyDeleteIt's amazing that over five years on, this is still one of the most popular blog postings I've written!
ReplyDeleteWhat's sad is that these problems in Eclipse still persist. Every other application I run can handle a crash with minimal problems.
ReplyDeleteBut 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
And lo, into 7 years, this is still an issue...
ReplyDeleteThankfully the .snap deletion fix still works.
February 2011, same problem, same solution, same result --> workspace works now, projects were gone but I was able to import them again.
ReplyDeletefebruary 2013 - same problem. workspace empty after fix.
ReplyDeleteseptember 2013
ReplyDeletesame problem
come on eclipse guys sort it out!
september 2013 - same problem, same fix but lost changes to a project which had a few large data files in it :/
ReplyDeletecome on eclipse sort it out!