Project: Eclipse_Platform_UI
Bug 6623 Threading problems on plugin startup
Reported: 2001-12-06 05:34:27 | Status: resolved fixed

Plugin-startup can be called in the UI-thread, but AbstractUIPlugin.refreshPluginActions then fails. org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:1887) at org.eclipse.swt.SWT.error(SWT.java:1819) at org.eclipse.swt.widgets.Widget.error(Widget.java:366) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Tree.getSelection(Tree.java(Compiled Code)) at org.eclipse.jface.viewers.TreeViewer.getSelection (TreeViewer.java:158) at org.eclipse.jface.viewers.AbstractTreeViewer.getSelectionFromWidget (AbstractTreeViewer.java:586) at org.eclipse.jface.viewers.StructuredViewer.getSelection (StructuredViewer.java:365) at org.eclipse.ui.internal.SelectionService.getSelection (SelectionService.java:64) at org.eclipse.ui.internal.WWinPluginAction.refreshSelection (WWinPluginAction.java:128) at org.eclipse.ui.internal.WWinPluginAction.refreshActionList (WWinPluginAction.java:52) at org.eclipse.ui.internal.Workbench.refreshPluginActions (Workbench.java:978) at org.eclipse.ui.plugin.AbstractUIPlugin.refreshPluginActions (AbstractUIPlugin.java:382) at org.eclipse.ui.plugin.AbstractUIPlugin.startup (AbstractUIPlugin.java:421) at org.eclipse.pde.selfhosting.internal.SelfHostingPlugin.startup (SelfHostingPlugin.java:176) at org.eclipse.core.internal.plugins.PluginDescriptor$1.run (PluginDescriptor.java:643) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:818) at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation (PluginDescriptor.java:655) at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation (PluginDescriptor.java:135) at org.eclipse.core.internal.plugins.PluginClassLoader.activatePlugin (PluginClassLoader.java:52) at org.eclipse.core.internal.plugins.PluginClassLoader.findClassParentsSelf (PluginClassLoader.java(Compiled Code)) at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass (DelegatingURLClassLoader.java(Compiled Code)) at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass (DelegatingURLClassLoader.java(Compiled Code)) at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code)) at org.eclipse.core.internal.plugins.PluginDescriptor.createExecutableExtension (PluginDescriptor.java:79) at org.eclipse.core.internal.plugins.PluginDescriptor.createExecutableExtension (PluginDescriptor.java:116) at org.eclipse.core.internal.plugins.ConfigurationElement.createExecutableExtension (ConfigurationElement.java:96) at org.eclipse.debug.internal.core.Launcher.getDelegate (Launcher.java:92) at org.eclipse.debug.internal.ui.LaunchHistoryElement.getLaunchElement (LaunchHistoryElement.java:111) at org.eclipse.debug.internal.ui.DebugUIPlugin.removeDeletedHistories (DebugUIPlugin.java:1352) at org.eclipse.debug.internal.ui.DebugUIPlugin.removeDeletedHistories (DebugUIPlugin.java:1340) at org.eclipse.debug.internal.ui.DebugUIPlugin$ResourceDeletedVisitor.visit (DebugUIPlugin.java:202) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.core.internal.events.ResourceDelta.accept (ResourceDelta.java(Compiled Code)) at org.eclipse.debug.internal.ui.DebugUIPlugin.resourceChanged (DebugUIPlugin.java:1178) at org.eclipse.core.internal.events.NotificationManager$1.run (NotificationManager.java:125) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java:818) at org.eclipse.core.runtime.Platform.run(Platform.java:395) at org.eclipse.core.internal.events.NotificationManager.notify (NotificationManager.java:140) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges (NotificationManager.java:43) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges (NotificationManager.java:64) at org.eclipse.core.internal.resources.Workspace.broadcastChanges (Workspace.java:110) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java(Compiled Code)) at org.eclipse.core.internal.resources.Workspace.build (Workspace.java:122) at org.eclipse.debug.internal.ui.DebugUIPlugin$9.run (DebugUIPlugin.java:1677) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:98)

Files changed in fix:
bundles/org.eclipse.ui/Eclipse UI/org/eclipse/ui/plugin/AbstractUIPlugin.java