Eclipse无法启动,日志错误说:ObjectNotFoundException:Tree元素

jep*_*rro 71 eclipse

昨晚我的机器在Eclipse Galileo打开时重新启动.没什么大不了的吧?

今天早上,我启动了我的机器并尝试打开Eclipse.我没有打开,而是看到了这个: 替代文字

错误日志表明退出未保存的更改会导致某种问题.

如何让Eclipse打开并忽略那些未保存的更改?我甚至无法用Eclipse打开一个不属于该项目的文本文件?必须有一种方法来重置这种状态.

编辑:

我已将问题跟踪到单个文件.当我在下面删除这个文件时,Eclipse会打开但我的项目会丢失.

.metadata\.plugins\org.eclipse.core.resources\.snap
Run Code Online (Sandbox Code Playgroud)

我确实使用了subversion插件,但我不认为这是问题所在.以下是错误日志所说的内容(缩写):

!SESSION 2010-08-17 10:13:01.718 -----------------------------------------------
eclipse.buildId=M20100211-1343
java.version=1.4.2_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Command-line arguments:  -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.core.resources 2 10035 2010-08-17 10:13:02.656
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.osgi 4 0 2010-08-17 10:13:02.671
!MESSAGE An error occurred while automatically activating bundle org.eclipse.core.resources (33).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
...

Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/reports/src/com/lang/reports/OnlineReport.java' not found.
    at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:257)
...

Root exception:
org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/reports/src/com/lang/reports/OnlineReport.java' not found.
    at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:257)
...

!ENTRY org.eclipse.osgi 4 0 2010-08-17 10:13:02.703
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:114)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)

!ENTRY org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.core_3.3.202.R35x_v20091130-2300 [103] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.pluggable.core_1.0.201.R35x_v20090925-1100 [104] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.eclipse.jdt.apt.core_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.dispatch_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.model_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.util_0.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.ui_3.3.200.v20090930-2100_R35x [105] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.apt.ui 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.eclipse.jdt.apt.core_[3.2.0,4.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.compiler.apt_1.0.201.R35x_v20090925-1100 [106] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.compiler.apt 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.compiler.tool_1.0.100.v_981_R35x [107] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.junit4.runtime_1.1.0.v20090513-2000 [116] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.junit4.runtime 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.junit4_[4.4.0,5.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.hamcrest.core_1.1.0.v20090501071000 [184] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.junit4_4.5.0.v20090824 [186] was not resolved.
!SUBENTRY 2 org.junit4 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.hamcrest.core_1.1.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle com.collabnet.subversion.merge_2.1.0 [208] was not resolved.
Run Code Online (Sandbox Code Playgroud)

Kri*_*hna 127

对于这个问题,我不得不删除.snap目录中的文件:

<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources
Run Code Online (Sandbox Code Playgroud)

删除该文件后,我能够毫无问题地启动Eclipse.

  • 在不丢失项目或任务的情况下工作:) Eclipse Juno(2013).谢谢! (2认同)
  • 递归删除 .snap 或所有 .snap 文件并没有解决我的问题。 (2认同)
  • 这也适用于 Eclipse Neon,尽管 .snap 位于 /.metadata/.plugins/org.eclipse.core.resources/.root (2认同)

pav*_*imo 67

推荐:删除<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources\.snap.这不会重置您的工作区,您的其他项目也不会被删除(由krishna回答).

不推荐:或者,<workspace-directory>\.metadata从工作区中删除整个目录并重新启动.这将重置您的工作区并删除其中的所有现有项目.

  • 我认为正确的答案应该是下面的答案.上面重置你的整个工作区,另一方面保持你所做的一切. (11认同)
  • 谢谢,这对我很有帮助.在删除.metadata中的.snap文件后,我至少能够重新启动eclipse.不幸的是我丢失了所有项目.最后,我不得不从subversion重新检查我的所有项目.但至少我起来又工作了. (2认同)
  • 为什么这是接受的答案.完全塞了我的安装,我花了几个小时来修复它. (2认同)

tra*_*ode 11

陷入这个错误.

我的.metadata文件夹中没有.snap文件.

我不得不删除这个:

<workspace>/.metadata/.plugins/org.eclipse.core.resources/.root/d+.tree
Run Code Online (Sandbox Code Playgroud)

d + =>某个数字.

然后我不得不重新导入项目并重新分配工作集.我更喜欢打开新工作区和重做设置.


小智 5

删除 .snap 文件非常适合我。

  1. 从目录中删除 .snap 文件 - workspace.metadata.plugins\org.eclipse.core.resources。
  2. 导入工作区(现有项目到工作区 - 不要再次将文件夹复制到工作区)。