Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 76384 - org.eclipse.team.ui loaded in headless applications
Summary: org.eclipse.team.ui loaded in headless applications
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-15 14:45 EDT by John Arthorne CLA
Modified: 2004-11-08 15:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2004-10-15 14:45:26 EDT
Build: 20040924

The Team.ui plugin is being started when running headless applications (such as
platform core test suites). This results in an error because it tries to access
the Workbench, which has never been started.  The error is:

!ENTRY org.eclipse.core.runtime 4 2 Oct 15, 2004 14:27:07.334
!MESSAGE An internal error occurred during: "".
!STACK 0
java.lang.IllegalStateException: Workbench has not been created yet.
        at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:92)
        at
org.eclipse.team.internal.ui.TeamCapabilityHelper.<init>(TeamCapabilityHelper.java:70)
        at
org.eclipse.team.internal.ui.TeamCapabilityHelper.getInstance(TeamCapabilityHelper.java:55)
        at org.eclipse.team.internal.ui.TeamUIPlugin$2.run(TeamUIPlugin.java:197)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)


The stack trace of the activation of the team.ui plugin is below.  The loading
of the file modification validator is causing team ui to load.

Thread [main] (Suspended (breakpoint at line 179 in
org.eclipse.team.internal.ui.TeamUIPlugin))
	org.eclipse.team.internal.ui.TeamUIPlugin.start(org.osgi.framework.BundleContext) line: 179
	org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run() line: 958
	java.security.AccessController.doPrivileged(java.security.PrivilegedExceptionAction) line: not available [native method]
	org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(org.osgi.framework.BundleActivator) line: 954
	org.eclipse.osgi.framework.internal.core.BundleContextImpl.start() line: 937
	org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(boolean) line: 421
	org.eclipse.osgi.framework.internal.core.BundleHost(org.eclipse.osgi.framework.internal.core.AbstractBundle).start() line: 293
	org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(java.lang.String) line: 110
	org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(java.lang.String) line: 371
	org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(java.lang.String) line: 402
	org.eclipse.core.runtime.adaptor.EclipseClassLoader(org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader).loadClass(java.lang.String, boolean) line: 93
	org.eclipse.core.runtime.adaptor.EclipseClassLoader(java.lang.ClassLoader).loadClass(java.lang.String) line: 235
	org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(java.lang.String) line: 307
	org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(java.lang.String,
boolean) line: 336
	org.eclipse.osgi.framework.internal.core.BundleHost(org.eclipse.osgi.framework.internal.core.AbstractBundle).loadClass(java.lang.String) line: 1313
	org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(org.osgi.framework.Bundle, java.lang.String, java.lang.Object, org.eclipse.core.runtime.IConfigurationElement, java.lang.String) line: 131
	org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(org.osgi.framework.Bundle, java.lang.String, java.lang.String, java.lang.Object, org.eclipse.core.runtime.IConfigurationElement, java.lang.String) line: 124
	org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(java.lang.String) line: 113
	org.eclipse.team.internal.core.FileModificationValidatorManager.loadDefaultValidator() line: 123
	org.eclipse.team.internal.core.FileModificationValidatorManager.getDefaultValidator() line: 109
	org.eclipse.team.internal.core.FileModificationValidatorManager.validateSave(org.eclipse.core.resources.IFile) line: 96
	org.eclipse.core.internal.resources.Workspace$6.run() line: 2229
	org.eclipse.core.internal.runtime.InternalPlatform.run(org.eclipse.core.runtime.ISafeRunnable) line: 616
	org.eclipse.core.runtime.Platform.run(org.eclipse.core.runtime.ISafeRunnable)
line: 747
	org.eclipse.core.internal.resources.Workspace.validateSave(org.eclipse.core.resources.IFile) line: 2236
	org.eclipse.core.internal.resources.File.setContents(java.io.InputStream, int,
org.eclipse.core.runtime.IProgressMonitor) line: 332
	org.eclipse.core.internal.localstore.FileSystemResourceManager.internalWrite(org.eclipse.core.resources.IProject, org.eclipse.core.resources.IProjectDescription, int, boolean, boolean) line: 287
	org.eclipse.core.internal.resources.Project.writeDescription(org.eclipse.core.resources.IProjectDescription, int, boolean, boolean) line: 1015
	org.eclipse.core.internal.resources.Project.writeDescription(int) line: 996
	org.eclipse.core.internal.resources.Project.create(org.eclipse.core.resources.IProjectDescription, org.eclipse.core.runtime.IProgressMonitor) line: 276
	org.eclipse.core.internal.resources.Project.create(org.eclipse.core.runtime.IProgressMonitor) line: 302
	org.eclipse.core.tests.resources.IResourceTest.setUp() line: 369
	org.eclipse.core.tests.resources.IResourceTest(junit.framework.TestCase).runBare() line: 125
	junit.framework.TestResult$1.protect() line: 106
	junit.framework.TestResult.runProtected(junit.framework.Test,
junit.framework.Protectable) line: 124
	junit.framework.TestResult.run(junit.framework.TestCase) line: 109
	org.eclipse.core.tests.resources.IResourceTest(junit.framework.TestCase).run(junit.framework.TestResult) line: 118
	junit.framework.TestSuite.runTest(junit.framework.Test,
junit.framework.TestResult) line: 208
	junit.framework.TestSuite.run(junit.framework.TestResult) line: 203
	org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner(org.eclipse.jdt.internal.junit.runner.RemoteTestRunner).runTests(java.lang.String[], java.lang.String) line: 421
	org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner(org.eclipse.jdt.internal.junit.runner.RemoteTestRunner).run() line: 305
	org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(java.lang.String[]) line: 30
	org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(java.lang.Object) line: 26
	org.eclipse.core.internal.runtime.PlatformActivator$1.run(java.lang.Object)
line: 335
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) line: 273
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String[],
java.lang.Runnable) line: 129
	sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method,
java.lang.Object, java.lang.Object[]) line: not available [native method]
	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object,
java.lang.Object[]) line: 39
	sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object,
java.lang.Object[]) line: 25
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) line: 324
	org.eclipse.core.launcher.Main.basicRun(java.lang.String[]) line: 185
	org.eclipse.core.launcher.Main.run(java.lang.String[]) line: 704
	org.eclipse.core.launcher.Main.main(java.lang.String[]) line: 688
Comment 1 Michael Valenta CLA 2004-11-08 15:47:53 EST
Fix released to HEAD. I added a shouldRun to the job that initializes the 
helper. It will not run if the workbench is not running.