gpt4 book ai didi

java - 从插件调用代码时出错 : "org.eclipse.jface"

转载 作者:行者123 更新时间:2023-12-01 18:40:09 25 4
gpt4 key购买 nike

我正在开发 STS IDE 版本 3.9.9.RELEASE。

我有一个 Spring Boot 应用程序,该应用程序运行得很好,突然发生了一件奇怪的事情。现在,当我尝试通过单击运行配置来配置运行环境时,我在错误日志中收到以下错误,并且无法运行我的应用程序。

当我点击运行配置时,我也会收到附加的弹出窗口

enter image description here

java.lang.NullPointerException
at org.eclipse.jdt.launching.JavaRuntime.newProjectRuntimeClasspathEntry(JavaRuntime.java:686)
at org.eclipse.m2e.jdt.internal.InternalModuleSupport.newModularProjectRuntimeClasspathEntry(InternalModuleSupport.java:367)
at org.eclipse.m2e.jdt.internal.ModuleSupport.newModularProjectRuntimeClasspathEntry(ModuleSupport.java:118)
at org.eclipse.m2e.jdt.internal.launch.MavenRuntimeClasspathProvider.computeUnresolvedClasspath(MavenRuntimeClasspathProvider.java:99)
at org.eclipse.jdt.internal.launching.RuntimeClasspathProvider.computeUnresolvedClasspath(RuntimeClasspathProvider.java:60)
at org.eclipse.jdt.launching.JavaRuntime.computeUnresolvedRuntimeClasspath(JavaRuntime.java:1636)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab.createClasspathModel(JavaClasspathTab.java:288)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab.refresh(JavaClasspathTab.java:276)
at org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab.initializeFrom(JavaClasspathTab.java:239)
at org.springframework.ide.eclipse.boot.launch.BootClasspathTab.initializeFrom(BootClasspathTab.java:41)
at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(AbstractLaunchConfigurationTabGroup.java:93)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.initializeFrom(LaunchConfigurationTabGroupWrapper.java:204)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(LaunchConfigurationTabGroupViewer.java:875)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.lambda$4(LaunchConfigurationTabGroupViewer.java:736)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:751)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput0(LaunchConfigurationTabGroupViewer.java:683)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:663)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:1050)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$4.selectionChanged(LaunchConfigurationsDialog.java:617)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:874)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:871)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1240)
at org.eclipse.jface.viewers.StructuredViewer.lambda$0(StructuredViewer.java:1263)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:259)
at org.eclipse.jface.util.OpenStrategy$1.lambda$1(OpenStrategy.java:429)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3933)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3564)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:821)
at org.eclipse.jface.window.Window.open(Window.java:797)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1239)
at org.eclipse.debug.ui.DebugUITools.lambda$1(DebugUITools.java:630)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:636)
at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:574)
at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:85)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:476)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:568)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4145)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1055)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1064)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:778)
at org.eclipse.jface.action.ActionContributionItem.lambda$8(ActionContributionItem.java:1260)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4145)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1055)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3958)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3561)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:628)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:199)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:391)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)

session 数据:

eclipse.buildId=3.9.9.201906181641-RELEASE-e49
java.version=1.8.0_102
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springsource.sts.ide
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide -clean

解决方案已尝试:我已经尝试过以下解决方案,但没有成功:

  1. 我尝试升级STS,升级成功。但是错误仍然存​​在。目前它处于 3.9.9.RELEASE 版本。
  2. 我也通过清理缓存使用命令提示符运行 IDE,应用程序正确打开,但错误仍然存​​在:

    STS.exe -clean

另附有错误事件的屏幕截图

enter image description here

最佳答案

以下解决方案对我有用

  1. 已从 STS-Eclipse 工作区中删除项目,方法是从工作区中删除项目,并确保不要删除项目的内容。
  2. 再次从同一目录导入项目。
  3. 右键单击项目 ---> 单击运行方式 --> 单击运行配置 ----> 添加新配置。现在我可以添加新配置,并且“应用按钮”也可以正常工作。
  4. 之前添加的配置仍然无法正常工作,但新添加的配置可以正常工作。

如果我们有其他解决方案来解决此问题,请告诉我

关于java - 从插件调用代码时出错 : "org.eclipse.jface",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59949800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com