打开xml文件时出现Eclipse问题

时间:2011-07-17 14:20:34

标签: xml eclipse macos m2e

由于某些原因我不能再打开普通的xml文件了。我做了一些测试,甚至还有一个新的,未经修改的eclipse副本(64位可可),我无法打开xml文件。我所做的是,创建了一个新的java项目,创建了一个新的xml文件。我得到的唯一信息是:

发生了错误。有关详细信息,请参阅错误日志 无法初始化类org.eclipse.m2e.editor.xml.PomContentAssistProcessor

任何想法可能是什么原因?

更新

我仔细查看了错误日志,显示如下:

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.m2e.editor.xml.PomContentAssistProcessor

以某种方式缺少依赖关系,但我不知道如何解决它。我试图重新安装m2e,但它只是告诉我它已经安装并且只会显示在已安装的应用程序中。

这是完整的堆栈跟踪,也许有人建议下一步该做什么。

java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.m2e.editor.xml.PomContentAssistProcessor
    at org.eclipse.m2e.editor.xml.PomStructuredTextViewConfiguration.getContentAssistProcessors(PomStructuredTextViewConfiguration.java:31)
    at org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration.getContentAssistant(StructuredTextViewerConfiguration.java:291)
    at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.configure(StructuredTextViewer.java:215)
    at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3407)
    at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54)
    at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:440)
    at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1508)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:241)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:211)
    at org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart.addSourcePage(XMLMultiPageEditorPart.java:509)
    at org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart.createPages(XMLMultiPageEditorPart.java:764)
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.EditorManager.findEditor(EditorManager.java:424)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2887)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:355)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
    at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4125)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3971)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3610)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    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:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

5 个答案:

答案 0 :(得分:3)

与indigo有同样的问题,只需打开原始下载的zip并覆盖插件目录中以org.eclipse.m2e.*开头的所有jar文件,问题就消失了。

答案 1 :(得分:2)

尝试打开XML或Java文件时出现类似问题:
org/eclipse/wst/xml/ui/internal/tabletree/XMLMultiPageEditorPart 无法打开xml或java文件。

Eclipse Kepler 4.3。 IDE因winturds系统重启而死亡 随后,启动IDE,错误

我聪明的解决方案:通过文件退出IDE:退出并重新启动IDE。这发生在以前。

您的里程可能会有所不同。

答案 2 :(得分:2)

我通过使用-clean参数启动Eclipse(Kepler)来实现这一点。

"d:\eclipse\eclipse.exe -clean"

当我尝试这个时,eclipse花费的时间比往常更多,因为它将清理和重新加载插件。

答案 3 :(得分:0)

如果新副本不起作用,则表示工作空间或项目元数据已损坏。尝试创建一个新工作区。

问题看起来与m2eclipse有关 - eclipse试图加载pom-editor但失败了。您也可以尝试安装/更新m2eclipse。

答案 4 :(得分:0)

与月神相同的问题。重新生成库插件依赖项对我有用。