redhat-developer / redhat-developer/vscode-java

java.lang.IllegalArgumentException Attempted to endRule & - java.lang.IllegalArgumentException Worker thread ended job: Classpath Update Job(29039), but still holds rule

Open
#3,997 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Hi,
We have a multi-module Gradle-based Java Spring application. When trying to open it in Cursor IDE with the Language Support for Java plugin enabled, the project does not fully load.

We had a circular dependency issue which i reported in https://github.com/microsoft/vscode-gradle/issues/1659 and https://github.com/redhat-developer/vscode-java/issues/3986 but it seems with Language Support for Java(TM) by Red Hat plugin Version 1.41.0, our gradle sub projects are visible as expected, without circular dependencies reported and without weird project names.

But now, with Language Support for Java(TM) by Red Hat plugin Version 1.41.0, when i open my project even java projects are visible in JAVA PROJECTS view, the code is not loaded, not detected properly after waiting for some hours.

I see the following kind of errors logged for plugin. There are too many logged errors. I am putting here just some samples.

[Error - 11:56:38] 31 Mar 2025, 11:56:38 An internal error occurred during: "Classpath Update Job".
Attempted to endRule: null, does not match most recent begin: R/.  See log for trace information if rule tracing is enabled.
java.lang.IllegalArgumentException: Attempted to endRule: null, does not match most recent begin: R/.  See log for trace information if rule tracing is enabled.
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:68)
	at org.eclipse.core.internal.jobs.ThreadJob.illegalPop(ThreadJob.java:126)
	at org.eclipse.core.internal.jobs.ThreadJob.pop(ThreadJob.java:391)
	at org.eclipse.core.internal.jobs.ImplicitJobs.end(ImplicitJobs.java:118)
	at org.eclipse.core.internal.jobs.JobManager.endRule(JobManager.java:799)
	at org.eclipse.core.internal.resources.WorkManager.checkOut(WorkManager.java:174)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1605)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:50)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

[Error - 11:56:38] 31 Mar 2025, 11:56:38 Worker thread ended job: Classpath Update Job(29039), but still holds rule: ThreadJob(Classpath Update Job(29039),[R/])
Worker thread ended job: Classpath Update Job(29039), but still holds rule: ThreadJob(Classpath Update Job(29039),[R/])
java.lang.IllegalStateException: Worker thread ended job: Classpath Update Job(29039), but still holds rule: ThreadJob(Classpath Update Job(29039),[R/])
	at org.eclipse.core.internal.jobs.ImplicitJobs.endJob(ImplicitJobs.java:139)
	at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:119)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:83)

Our installed versions;
OS Version: macos 15.3.2 (24D81)
Gradle: 8.12.1
Java: OpenJDK 21.0.3 LTS
Spring Boot: 3.4.3
Cursor Version: 0.47.8 (Universal)
Language Support for Java(TM) by Red Hat plugin Version 1.41.0
vscode-gradle Extension Version: 3.16.4

It looks like the issue is related to latest Language Support for Java(TM) by Red Hat plugin Version 1.41.0 version.
Can you please have a look ?

Thanks in advance
Ramazan

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the multi-module Gradle project with the listed Java, Cursor, and Language Support for Java versions, then inspect the Classpath Update Job errors. Trace the reported path through JobManager.endRule, WorkManager.checkOut, and Workspace.endOperation. Done means the project loads correctly without the rule-mismatch and worker-thread errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, vscode
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.