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

Bug 325155

Summary: java.lang.IllegalStateException: Workbench has not been created yet.
Product: [Eclipse Project] Platform Reporter: Dimo Stoilov <Dimo.Stoilov>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 4.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Whiteboard:
Attachments:
Description Flags
the exeption trace
none
console output none

Description Dimo Stoilov CLA 2010-09-13 15:15:23 EDT
Build Identifier: 20100617-1415

We get this exception if our junit plugin tests are launched only the required plugins. Among the selected required plugins are org.eclipse.ui and org.eclipse.ui.workbench.

Reproducible: Always

Steps to Reproduce:
In a class our plugin under test we have the following imports: 
import org.eclipse.debug.ui.console.IConsole;
import org.eclipse.debug.ui.console.IConsoleLineTracker;


When instansiating the class we have Caused by: java.lang.IllegalStateException: Workbench has not been created yet.
	at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
	at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.startup(LaunchingResourceManager.java:542)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.getLaunchingResourceManager(DebugUIPlugin.java:301)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.start(DebugUIPlugin.java:502)

Our real case actually is the Tycho test infrastucture which under the hood runs an eclipse installation with the required bundles only.
Comment 1 Dimo Stoilov CLA 2010-09-13 15:17:59 EDT
Created attachment 178768 [details]
the exeption trace
Comment 2 Dimo Stoilov CLA 2010-09-13 15:19:12 EDT
Created attachment 178769 [details]
console output
Comment 3 Eric Moffatt CLA 2010-09-13 16:16:30 EDT
How does it determine the 'required' bundles? If you use the Configuration Dialog to create a specific launch config, select your plugin(s) and then hit the 'Add Required Plug-ins' button does the resulting config work? If it does perhaps you might look for a discrepancy between what it has and what your current one computes ??
Comment 4 Paul Webster CLA 2010-09-14 07:22:06 EDT
You cannot access debug UI classes until the workbench is fully initialized (cannot access most things that come out of org.eclipse.ui/org.eclipse.ui.workbench).

When you run your junit plugin tests, what application are you using (either directly, or through your product)?

PW