Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 105453

Summary: [RCP] PlatformUI.isWorkbenchRunning() fails if runtime shutdown
Product: [Eclipse Project] Platform Reporter: Nick Edgar <n.a.edgar>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P5 CC: pascal
Version: 3.1Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Nick Edgar CLA 2005-07-28 11:07:01 EDT
3.1

- create a "hello world" headless app (just writing to console), but where the
plug-in class extends AbstractUIPlugin
- the following exceptions occur:

java.lang.NullPointerException
	at org.eclipse.core.runtime.adaptor.EclipseLog.write(EclipseLog.java:512)
	at org.eclipse.core.runtime.adaptor.EclipseLog.writeSession(EclipseLog.java:181)
	at org.eclipse.core.runtime.adaptor.EclipseLog.log(EclipseLog.java:283)
	at
org.eclipse.core.runtime.adaptor.EclipseAdaptor.handleRuntimeError(EclipseAdaptor.java:778)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1243)
	at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:189)
	at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:291)
Logging to the console instead.

!ENTRY org.eclipse.osgi 2005-07-27 15:58:00.202
!MESSAGE An unexpected runtime error has occurred.
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/ui/application/IWorkbenchConfigurer
	at org.eclipse.ui.PlatformUI.isWorkbenchRunning(PlatformUI.java:107)
	at
org.eclipse.ui.plugin.AbstractUIPlugin.refreshPluginActions(AbstractUIPlugin.java:472)
	at
org.eclipse.ui.plugin.AbstractUIPlugin$2.bundleChanged(AbstractUIPlugin.java:594)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:1205)
	at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:189)
	at
org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:291)
Comment 1 Nick Edgar CLA 2005-07-28 11:09:27 EDT
This occurs because the workbench has not been run, but when
PlatformUI.isWorkbenchRunning() is called, it tries to resolve class Workbench
and others, which fails because the runtime has already been shut down.

Both the runtime logging and PlatformUI.isWorkbenchRunning() should be resilient
to this.
Comment 2 Nick Edgar CLA 2006-03-15 11:24:32 EST
Reassigning bugs in component areas that are changing ownership.
Comment 3 Kevin McGuire CLA 2007-06-21 17:07:13 EDT
Lowering priority in absence of product fail case
Comment 4 Boris Bokowski CLA 2009-11-26 16:15:10 EST
Prakash is now responsible for watching bugs in the [RCP] component area.
Comment 5 Eclipse Webmaster CLA 2019-09-06 15:29:45 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 6 Eclipse Genie CLA 2021-09-09 19:19:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.