Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325155 - java.lang.IllegalStateException: Workbench has not been created yet.
Summary: java.lang.IllegalStateException: Workbench has not been created yet.
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-13 15:15 EDT by Dimo Stoilov CLA
Modified: 2010-09-14 07:22 EDT (History)
1 user (show)

See Also:


Attachments
the exeption trace (8.82 KB, text/plain)
2010-09-13 15:17 EDT, Dimo Stoilov CLA
no flags Details
console output (16.71 KB, text/plain)
2010-09-13 15:19 EDT, Dimo Stoilov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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