Eclipse 无法启动,日志错误显示:ObjectNotFoundException: Tree element

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3505187/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:34:54  来源:igfitidea点击:

Eclipse won't start, log error says: ObjectNotFoundException: Tree element

eclipse

提问by jeph perro

Last night my machine restarted while Eclipse Galileo was open. No big deal, right?

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

This morning, I started my machine and tried to open Eclipse. Instead of opening, I see this: alt text

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

The error log suggests that there is some kind of problem caused by exiting with unsaved changes.

错误日志表明存在因未保存更改退出而导致的某种问题。

How can I get Eclipse to open and ignore those unsaved changes? I can't even open a text file that is not part of this project with Eclipse? There must be a way to reset this state.

如何让 Eclipse 打开并忽略那些未保存的更改?我什至无法使用 Eclipse 打开不属于该项目的文本文件?必须有一种方法可以重置此状态。

EDIT:

编辑:

I have tracked down the problem to a single file. When I delete this file below, Eclipse opens but my projects are missing.

我已将问题追溯到单个文件。当我删除下面的这个文件时,Eclipse 会打开但我的项目丢失了。

.metadata\.plugins\org.eclipse.core.resources\.snap

I do use the subversion plugin, but I don't think that is the problem. Here is what the error log says ( abbreviated ):

我确实使用了 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.

采纳答案by pavanlimo

Recommended:Delete <workspace-directory>\.metadata\.plugins\org.eclipse.core.resources\.snap. This will not reset your workspace and your other projects won't get deleted (as answered by krishna).

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

Not Recommended:Alternatively, delete the the whole <workspace-directory>\.metadatadirectory from your workspace and restart.This will reset your workspace and delete all your existing projects in it.

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

回答by Krishna

For this issue I had to delete the .snapfile located in the directory :

对于这个问题,我必须删除.snap位于目录中的文件:

<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources

After deleting that file, I was able to start my Eclipse with no problem.

删除该文件后,我可以毫无问题地启动我的 Eclipse。

回答by trappedIntoCode

Ran into this error.

遇到了这个错误。

There was no .snap file in my .metadata folder.

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

I had to delete this:

我不得不删除这个:

<workspace>/.metadata/.plugins/org.eclipse.core.resources/.root/d+.tree

d+=> some number.

d+=> 一些数字。

Then I had to re-import the projects and re-assign the working sets. I preferred it over opening a new workspace and redoing settings.

然后我不得不重新导入项目并重新分配工作集。我更喜欢它而不是打开一个新的工作区和重做设置。

回答by softarchsolutions

Deleting .snap file worked perfect for me.

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

  1. Delete .snap file from the directory - workspace.metadata.plugins\org.eclipse.core.resources.
  2. Import the workspace (existing projects into workspace - do not copy folders into workspace again).
  1. 从目录中删除 .snap 文件 - workspace.metadata.plugins\org.eclipse.core.resources。
  2. 导入工作区(现有项目到工作区 - 不要再次将文件夹复制到工作区)。

回答by Jim

Had similar problem.

有类似的问题。

Log file said exception was caused by corruption in the project tree -- a very vague description.

日志文件说异常是由项目树中的损坏引起的——一个非常模糊的描述。

Deleting individual files and directories in /.metadata/.plugins/org.eclipse.core.resources didn't work for me. I had to delete the entire /.metadata/.plugins/org.eclipse.core.resources directory. I lost the entire project tree but not the projects. They were still in the workspace and just needed to be imported back into Eclipse. I also did not lose the large numbers of plugins configured for working Java, Android, PHP, C++, J2EE, etc.

删除 /.metadata/.plugins/org.eclipse.core.resources 中的单个文件和目录对我不起作用。我不得不删除整个 /.metadata/.plugins/org.eclipse.core.resources 目录。我丢失了整个项目树,但没有丢失项目。它们仍在工作区中,只需要重新导入 Eclipse。我也没有丢失为 Java、Android、PHP、C++、J2EE 等配置的大量插件。

This is the second time I encountered a project tree related corruption. The first time I deleted the .metadata altogether and then spent a very long time putting back all the plugins and projects. The direction the other answers here were useful in zeroing in on just the org.eclipse.core.resources directory. Seems deleting the whole directory just results in only needing to reimport all the projects.

这是我第二次遇到与项目树相关的损坏。我第一次完全删除了 .metadata,然后花了很长时间放回所有插件和项目。此处的其他答案的方向在将 org.eclipse.core.resources 目录归零时很有用。似乎删除整个目录只会导致只需要重新导入所有项目。

Your mileage may vary...

你的旅费可能会改变...

回答by Alicia Seffernik

This also works when you receive this error from Information Design Tool (IDT) (Business Objects BI4).

当您从信息设计工具 (IDT) (Business Objects BI4) 收到此错误时,这也适用。

  1. Delete .snap file from this directory.
    Please note that you Will lose all your local projects. Hopefully your modifications have been recently saved to a repository.
  1. 从此目录中删除 .snap 文件。
    请注意,您将丢失所有本地项目。希望您的修改最近已保存到存储库中。

Directory - C:\Users\xxxxuser.name.businessobjects\bimodeler_14\workspace.metadata.plugins\org.eclipse.core.resources\

目录 - C:\Users\xxxxuser.name.businessobjects\bimodeler_14\workspace.metadata.plugins\org.eclipse.core.resources\

回答by Sanjaya Karunarathna

For anyone interested, I had the exact same problem and deleting the file .metadata/.plugins/org.eclipse.core.resources/.snap did the trick for me.

对于任何感兴趣的人,我遇到了完全相同的问题,删除文件 .metadata/.plugins/org.eclipse.core.resources/.snap 对我有用。

回答by Bharath

I also had the same problem, this happens when you force shutdown/restart your computer, while your eclipse still running. Deleting .metadata folder worked for me. Delete all the metadata and then import your project from that same workspace.

我也遇到了同样的问题,当您强制关闭/重新启动计算机时会发生这种情况,而您的 eclipse 仍在运行。删除 .metadata 文件夹对我有用。删除所有元数据,然后从同一个工作区导入您的项目。

回答by Rohan P

Rather deleting whole .metadata folder, which in turns delete your projects from workspace, try to find the .snap files and delete them. .snap files are the snapshot of workspace's temporary instance which will be saved on clean & close of workspace.

而不是删除整个 .metadata 文件夹,这反过来又从工作区中删除您的项目,尝试找到 .snap 文件并删除它们。.snap 文件是工作区临时实例的快照,将在清理和关闭工作区时保存。

回答by rachana

Delete all the *.Snap files in the path workspace-directory>.metadata.plugins\org.eclipse.core.resources

删除路径workspace-directory>.metadata.plugins\org.eclipse.core.resources中的所有*.Snap文件