调用JFace插件时出现Eclipse空指针异常
Eclipse null pointer exception when invoking JFace plugin
我在 CentOS 上安装了 eclipse Mars,但无法访问项目属性中的 "java build path"、"deployment assembly"、"project facets" 和其他一些选项卡。
出现 Problems occurred after invoking code from plug-in "org.eclipse.jface".
错误 windows,所以我附上了其详细信息的屏幕截图。
我搜索并尝试了很多解决方案(包括清理项目、切换工作区、创建新项目、删除 .classpath、.project 和 .settings、使用 --clean、clean IDE install 启动 eclipse、更改 JDK),但 none 目前有效。有人打过吗?
编辑:异常堆栈跟踪文本
java.lang.NullPointerException
at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(TabFolder.java:490)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1994)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4723)
at org.eclipse.swt.internal.gtk.OS._gtk_widget_show(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_widget_show(OS.java:14720)
at org.eclipse.swt.widgets.TabFolder.createItem(TabFolder.java:274)
at org.eclipse.swt.widgets.TabItem.createWidget(TabItem.java:123)
at org.eclipse.swt.widgets.TabItem.<init>(TabItem.java:75)
at org.eclipse.jst.servlet.ui.internal.WebModuleDependencyPageProvider.createRootControl(WebModuleDependencyPageProvider.java:77)
at org.eclipse.wst.common.componentcore.ui.propertypage.ModuleAssemblyRootPage.createContents(ModuleAssemblyRootPage.java:204)
at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:241)
at org.eclipse.wst.common.componentcore.ui.propertypage.ModuleAssemblyRootPage.createControl(ModuleAssemblyRootPage.java:346)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1450)
at org.eclipse.jface.preference.PreferenceDialog.run(PreferenceDialog.java:1217)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1209)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:608)
at org.eclipse.jface.preference.PreferenceDialog.run(PreferenceDialog.java:675)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog.selectionChanged(PreferenceDialog.java:670)
at org.eclipse.jface.viewers.StructuredViewer.run(StructuredViewer.java:877)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:874)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1243)
at org.eclipse.jface.viewers.StructuredViewer.widgetSelected(StructuredViewer.java:1269)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:265)
at org.eclipse.jface.util.OpenStrategy.access(OpenStrategy.java:259)
at org.eclipse.jface.util.OpenStrategy.run(OpenStrategy.java:440)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3794)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3433)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
at org.eclipse.jface.window.Window.open(Window.java:803)
at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1127)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:654)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
EDIT2:感谢大家的帮助。我解决这个问题的方法:像@howgler 说的那样更新 eclipse,导入到新工作区并清理每个项目。如果需要,导入到另一个工作区。不要忘记备份旧工作区,因为它可能会因版本差异而改变。
known bug 已在 Eclipse Oxygen.0 (4.7.0) 中修复。
从不再维护的 Eclipse Mars (4.5) 到 Eclipse Oxygen (4.7) 的 应该可以解决您的问题。
我在 CentOS 上安装了 eclipse Mars,但无法访问项目属性中的 "java build path"、"deployment assembly"、"project facets" 和其他一些选项卡。
出现 Problems occurred after invoking code from plug-in "org.eclipse.jface".
错误 windows,所以我附上了其详细信息的屏幕截图。
我搜索并尝试了很多解决方案(包括清理项目、切换工作区、创建新项目、删除 .classpath、.project 和 .settings、使用 --clean、clean IDE install 启动 eclipse、更改 JDK),但 none 目前有效。有人打过吗?
编辑:异常堆栈跟踪文本
java.lang.NullPointerException
at org.eclipse.swt.widgets.TabFolder.gtk_switch_page(TabFolder.java:490)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1994)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4723)
at org.eclipse.swt.internal.gtk.OS._gtk_widget_show(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_widget_show(OS.java:14720)
at org.eclipse.swt.widgets.TabFolder.createItem(TabFolder.java:274)
at org.eclipse.swt.widgets.TabItem.createWidget(TabItem.java:123)
at org.eclipse.swt.widgets.TabItem.<init>(TabItem.java:75)
at org.eclipse.jst.servlet.ui.internal.WebModuleDependencyPageProvider.createRootControl(WebModuleDependencyPageProvider.java:77)
at org.eclipse.wst.common.componentcore.ui.propertypage.ModuleAssemblyRootPage.createContents(ModuleAssemblyRootPage.java:204)
at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:241)
at org.eclipse.wst.common.componentcore.ui.propertypage.ModuleAssemblyRootPage.createControl(ModuleAssemblyRootPage.java:346)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1450)
at org.eclipse.jface.preference.PreferenceDialog.run(PreferenceDialog.java:1217)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1209)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:608)
at org.eclipse.jface.preference.PreferenceDialog.run(PreferenceDialog.java:675)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog.selectionChanged(PreferenceDialog.java:670)
at org.eclipse.jface.viewers.StructuredViewer.run(StructuredViewer.java:877)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:874)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1243)
at org.eclipse.jface.viewers.StructuredViewer.widgetSelected(StructuredViewer.java:1269)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:265)
at org.eclipse.jface.util.OpenStrategy.access(OpenStrategy.java:259)
at org.eclipse.jface.util.OpenStrategy.run(OpenStrategy.java:440)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3794)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3433)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
at org.eclipse.jface.window.Window.open(Window.java:803)
at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4481)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1327)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3819)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3430)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1127)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:654)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
EDIT2:感谢大家的帮助。我解决这个问题的方法:像@howgler 说的那样更新 eclipse,导入到新工作区并清理每个项目。如果需要,导入到另一个工作区。不要忘记备份旧工作区,因为它可能会因版本差异而改变。
known bug 已在 Eclipse Oxygen.0 (4.7.0) 中修复。
从不再维护的 Eclipse Mars (4.5) 到 Eclipse Oxygen (4.7) 的