Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
org.eclipse.swt.SWTException:来自HandledContributionItem的线程访问无效_Eclipse_Multithreading_Eclipse Plugin_Swt - Fatal编程技术网

org.eclipse.swt.SWTException:来自HandledContributionItem的线程访问无效

org.eclipse.swt.SWTException:来自HandledContributionItem的线程访问无效,eclipse,multithreading,eclipse-plugin,swt,Eclipse,Multithreading,Eclipse Plugin,Swt,我知道这里有很多这样的问题,而且大部分都得到了回答。但答案不能解决我的问题 我正在做一个eclipse插件项目,有一个定制的项目类型,可以运行或调试。我已经实现了run and debug功能,屏幕上显示了我期望的所有内容,除了控制台显示异常: !ENTRY org.eclipse.e4.ui.workbench 4 0 2015-04-28 23:31:17.410 !MESSAGE Internal error during tool item enablement updating, th

我知道这里有很多这样的问题,而且大部分都得到了回答。但答案不能解决我的问题

我正在做一个eclipse插件项目,有一个定制的项目类型,可以运行或调试。我已经实现了run and debug功能,屏幕上显示了我期望的所有内容,除了控制台显示异常:

!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-04-28 23:31:17.410
!MESSAGE Internal error during tool item enablement updating, this is only       logged once per tool item.
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4441)
at org.eclipse.swt.SWT.error(SWT.java:4356)
at org.eclipse.swt.SWT.error(SWT.java:4327)
at org.eclipse.swt.widgets.Widget.error(Widget.java:783)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:574)
at org.eclipse.swt.widgets.Widget.getData(Widget.java:874)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateIcons(HandledContributionItem.java:546)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:440)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:430)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$3.run(HandledContributionItem.java:168)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateItemEnablement(HandledContributionItem.java:196)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolItemUpdater.updateContributionItems(ToolItemUpdater.java:39)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$8.changed(ToolBarManagerRenderer.java:367)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
at org.eclipse.ui.internal.services.EvaluationService.contextEvaluate(EvaluationService.java:139)
at org.eclipse.ui.internal.services.EvaluationService.addSourceProvider(EvaluationService.java:180)
at org.eclipse.debug.internal.ui.contexts.DebugContextSourceProvider.<init>(DebugContextSourceProvider.java:51)
at org.eclipse.debug.internal.ui.contexts.DebugWindowContextService.<init>(DebugWindowContextService.java:62)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.createService(DebugContextManager.java:163)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getContextService(DebugContextManager.java:221)
at org.eclipse.debug.internal.ui.views.ViewContextService.<init>(ViewContextService.java:620)
at org.eclipse.debug.internal.ui.views.ViewContextManager.windowOpened(ViewContextManager.java:93)
at org.eclipse.debug.internal.ui.views.ViewContextManager.<init>(ViewContextManager.java:55)
at org.eclipse.debug.internal.ui.views.ViewContextManager.getDefault(ViewContextManager.java:44)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getDefault(DebugContextManager.java:150)
at org.eclipse.debug.ui.DebugUITools.getDebugContextManager(DebugUITools.java:1068)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupService.<init>(SourceLookupService.java:40)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.windowOpened(SourceLookupManager.java:91)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.<init>(SourceLookupManager.java:41)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.getDefault(SourceLookupManager.java:53)
at org.eclipse.debug.internal.ui.DebugUIPlugin.initializeLaunchListeners(DebugUIPlugin.java:935)
at org.eclipse.debug.internal.ui.DebugUIPlugin.launchAdded(DebugUIPlugin.java:920)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.run(LaunchManager.java:451)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.notify(LaunchManager.java:438)
at org.eclipse.debug.internal.core.LaunchManager.fireUpdate(LaunchManager.java:1044)
at org.eclipse.debug.internal.core.LaunchManager.addLaunch(LaunchManager.java:708)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:834)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
这将触发LaunchConfigurationWindow,并且不会在控制台中显示任何异常。当我在这个窗口中点击“run”时,进程在下面代码的第一行停止,在那里我有一个断点,并在控制台中显示异常

Display.getDefault().syncExec(新的Runnable()){
@凌驾
公开募捐{
//清除旧输出
HTMLOutput HTMLOutput=(HTMLOutput)平台UI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(“my.view.id”);
}
}

从异常的堆栈跟踪中,我看不到与我的代码相关的任何内容。如果我让程序继续运行,一切正常,我看不出该异常导致的任何问题,但我无法理解它是关于什么的,甚至无法阻止它的出现。请在这个问题上帮助我。

似乎您在Eclipse中遇到了一个错误。问题是ame stacktrace在中进行了描述。此错误报告(请参阅注释4)中描述的解决方法也可能对您的情况有所帮助:

作为这个问题的当前本地解决方法,我在rcp代码中添加了一个从UI线程对DebugUITools.getDebugContextManager()的早期调用。 丑陋,应该不需要,但它避免了第一次发射时出现的故障


这是Eclipse的哪个版本?