Skip to content

Job framework become unusable after stopping and restarting the "org.eclipse.core.jobs" bundle #2783

Description

@pms1

Let's make sure issue is not already fixed in latest builds first.

Not checked with the latest Build, but checked that the affected bundle has been unchanged compared to the version I tried with.

Steps to reproduce

  • In a running application, stop the "org.eclipse.core.jobs" bundle
  • restart the bundle
  • create a new job

This fails with an exception

I expected: That the bundle can be stopped and restarted

But got: it becomes unusable after restarting

Looking at the failing code, it looks like the class "InternalJob" keeps a cached instance of the first ever created JobManager in a static final field and only uses that for all created instances of InternalJob instead of using the current running JobManager.

Here is some relevant log output

From <workspace>/.metadata/.log

Command-line arguments:  -application eclipse-core-jobs-sample.id1 -data W:\fis\ws\fa_99.99.0/../runtime-eclipse-core-jobs-sample.id1 -dev file:///W:/fis/ws/fa_99.99.0/.metadata/.plugins/org.eclipse.pde.core/eclipse-core-jobs-sample.id1/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.osgi 4 0 2026-06-28 11:40:00.218
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Job manager has been shut down.
	at org.eclipse.core.internal.jobs.JobManager.scheduleInternal(JobManager.java:1485)
	at org.eclipse.core.internal.jobs.JobManager.lambda$5(JobManager.java:1475)
	at org.eclipse.core.internal.jobs.JobManager.withWriteLock(JobManager.java:568)
	at org.eclipse.core.internal.jobs.JobManager.schedule(JobManager.java:1474)
	at org.eclipse.core.internal.jobs.InternalJob.schedule(InternalJob.java:402)
	at org.eclipse.core.runtime.jobs.Job.schedule(Job.java:654)
	at sample.Application.start(Application.java:35)

Code for reproduction

		BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext();
		
		Bundle coreJobs = Arrays.stream(	bundleContext.getBundles()).filter(x -> x.getSymbolicName().equals("org.eclipse.core.jobs")).findFirst().orElseThrow();
		
		coreJobs.stop();
		
		coreJobs.start();
		
		Job job = new Job("test") {

			@Override
			protected IStatus run(IProgressMonitor monitor) {
				return Status.OK_STATUS;
			}
		};
		job.schedule();

Tested under this environment:

  • OS & version: Windows, 11
  • Eclipse IDE/Platform version (as shown in Help > About): Eclipse 25-12

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions