Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
Milestone
Description
Describe the bug
When loading a Spring Boot project containing approximately 3300 Java files, the Spring Boot Tools plugin (v1.58.0) causes the Java Searching phase of the Java Extension Pack to be stuck for a prolonged period, and the project fails to load. However, disabling the Spring Boot Tools plugin ensures that the Java Searching phase completes successfully.
Additionally, the issue persists even when using the pre-release version of Spring Boot Tools.
While the project is stuck, an exception is observed in the Spring Boot Tools logs, which seems to be related to the issue.
To Reproduce
- Install:
• Spring Boot Tools (v1.58.0 or pre-release).
• Java Extension Pack (including Language Support for Java(TM) by Red Hat v1.37.0). - Use Remote SSH to open a Spring Boot project with 3300 Java files.
- Observe that Java Searching gets stuck.
- Check the Spring Boot Tools logs for an exception.
- Disable Spring Boot Tools and reload the project; it loads successfully.
log
19:32:43.343 [pool-3-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-6] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-2] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.343 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - request for workspace symbols arrived: @/
19:32:43.343 [pool-3-thread-6] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - workspace symbol computation done: 0
19:32:43.512 [Simple-Language-Server main thread] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - file created event: [file:///home/frost/codes/work/test/.attach_pid237143]
19:32:43.513 [Simple-Language-Server main thread] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - file deleted event: [file:///home/frost/codes/work/test/.attach_pid237143]
19:32:50.331 [parallel-5] ERROR o.s.i.v.b.jdt.ls.JdtLsProjectCache - Unexpected error registering classpath listener with JDT.
java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'Mono.thenReturn ⇢ at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager.addClasspathListener(ClasspathListenerManager.java:144)' (and no fallback has been configured)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:296)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.MonoTimeout] :
reactor.core.publisher.Mono.timeout(Mono.java:5008)
org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:274)
Error has been observed at the following site(s):
*________Mono.timeout ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:274)
|_ Mono.doOnSubscribe ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:275)
|_ Mono.doOnSuccess ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:276)
Original Stack Trace:
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:296)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.doTimeout(FluxTimeout.java:281)
at reactor.core.publisher.FluxTimeout$TimeoutTimeoutSubscriber.onNext(FluxTimeout.java:420)
at reactor.core.publisher.FluxOnErrorReturn$ReturnSubscriber.onNext(FluxOnErrorReturn.java:162)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:270)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:285)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
19:32:50.333 [parallel-5] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Enable classpath listener enabled = false current enablement = true
19:32:50.333 [parallel-5] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Removing classpath listener enabled=false
19:32:50.333 [parallel-5] INFO o.s.i.v.b.jdt.ls.JdtLsProjectCache - Project Observer is not supported
19:32:50.333 [parallel-5] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'Mono.thenReturn ⇢ at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager.addClasspathListener(ClasspathListenerManager.java:144)' (and no fallback has been configured)
Caused by: java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'Mono.thenReturn ⇢ at org.springframework.ide.vscode.commons.languageserver.java.ls.ClasspathListenerManager.addClasspathListener(ClasspathListenerManager.java:144)' (and no fallback has been configured)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:296)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.MonoTimeout] :
reactor.core.publisher.Mono.timeout(Mono.java:5008)
org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:274)
Error has been observed at the following site(s):
*________Mono.timeout ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:274)
|_ Mono.doOnSubscribe ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:275)
|_ Mono.doOnSuccess ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:276)
|_ Mono.doOnError ⇢ at org.springframework.ide.vscode.boot.jdt.ls.JdtLsProjectCache.enableClasspathListener(JdtLsProjectCache.java:277)
Original Stack Trace:
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:296)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.doTimeout(FluxTimeout.java:281)
at reactor.core.publisher.FluxTimeout$TimeoutTimeoutSubscriber.onNext(FluxTimeout.java:420)
at reactor.core.publisher.FluxOnErrorReturn$ReturnSubscriber.onNext(FluxOnErrorReturn.java:162)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:270)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:285)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
19:35:38.865 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///home/frost/codes/work/test/yudao-module-infra/yudao-module-infra-biz/src/test/resources/logback.xml
19:35:38.865 [pool-13-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - Invalidate AST for file:///home/frost/codes/work/test/yudao-module-infra/yudao-module-infra-biz/src/test/resources/logback.xml
19:35:39.492 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///home/frost/codes/work/test/yudao-module-system/yudao-module-system-biz/src/test/resources/logback.xml
19:35:39.492 [pool-13-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - Invalidate AST for file:///home/frost/codes/work/test/yudao-module-system/yudao-module-system-biz/src/test/resources/logback.xml
19:35:41.966 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleTextDocumentService - Closed: file:///home/frost/codes/work/test/yudao-server/src/main/resources/logback-spring.xml
19:35:41.966 [pool-13-thread-1] INFO o.s.i.v.b.j.u.CompilationUnitCache - Invalidate AST for file:///home/frost/codes/work/test/yudao-server/src/main/resources/logback-spring.xml
19:36:54.083 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - shutdown: request arrived
19:36:54.084 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - shutdown: call shutdown handler
19:36:54.087 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - shutdown: complete
19:36:54.094 [pool-13-thread-1] INFO o.s.i.v.c.l.u.SimpleLanguageServer - exit: notification received
19:54:44.687 [Simple-Language-Server main thread] INFO o.s.i.v.c.l.u.SimpleWorkspaceService - file created event: [file:///home/frost/codes/work/test/.git/index]Sample
Activity
martinlippert commentedon Nov 29, 2024
Can you take a look into the log of the Java tooling as well and attach the output here? (both the java extension log and the java language server log
You can open both via the command for
Java: Open All Log FilesThe exception above looks like the Spring tooling waits too long for the Java tooling to respond when registering some listeners, so might be worth looking into what happens over there as well.
If you import the project without the Spring Tools enabled, how long does it take for the project to be fully imported and the Java tooling is done with background jobs?
Skyxim commentedon Nov 29, 2024
Edited and attached the springboot tools log when the problem occurred
Java Log
Spring Log
Skyxim commentedon Nov 29, 2024
https://github.com/YunaiV/ruoyi-vue-pro.git
Maybe you can use this project to test it, I used it and it was able to trigger once in 3 times
BoykoAlex commentedon Nov 29, 2024
@Skyxim thanks for the sample project!!! I wasn't able to reproduce the issue so far. By "Once in 3 times" you mean you execute "Reload Window" command in VSCode and every third time you see "Searching..." op from Java tooling gets stuck at startup, correct?
I noticed some odd log statements on the Java Tooling log. Closer to the end Java LS received a "shutdown" message and started stopping plugins. At the same time Spring LS attempts to register classpath listeners and fails because Java LS already stopped many bundles hence classpath listener fails to be registered:
I'd try and look for the reason for the shutdown on the Java LS side... All of this requires investigation...
Skyxim commentedon Nov 30, 2024
use
Java: Clean Java Language Server Workspace, then reload windowSkyxim commentedon Dec 1, 2024
I tried it today on Github Codespace and found that it does not get stuck at
Java Searching .... I also did not encounter this problem on my Mac mini. It seems that both my computers (home and work) are running LXC with PVE as the development environment. At the same time, the problem of getting stuck atJava Searching ...also occurs on PVE HOST.When I have time I will install a Debian VM in PVE and try this problem again.
Skyxim commentedon Dec 2, 2024
This problem seems to only occur under Debian. I also encountered it when I installed a virtual machine with Debian 12. I tried to install almalinux LXC in my PVE but did not encounter this problem. You may need to switch the development environment or use container development to solve it.
Skyxim commentedon Dec 2, 2024
I deleted
~/.vscode-serverand re-downloaded all extensions, and I don’t seem to encounter this problem anymore. I'm not sure if it's completely avoided, but it temporarily solved my problemmartinlippert commentedon Dec 4, 2024
Thanks a lot @Skyxim for the update on this and glad to hear that it looks like the problem is solved for the moment. Since there is nothing we can further investigate here, let's close the issue. If you come across this issue again, please comment and we can re-open anytime.
CloudSen commentedon Jan 23, 2025
Unfortunately, this problem still exists.
Environment
What Happend
When I open the project, the build always gets stuck at:
I tried running Java: Clean Java Language Server Workspace and mvn clean, and even reinstalled the plugin, but none of it worked.
If I disable
vmware.vscode-spring-bootplugin, all problems are solved.logs when disable
vmware.vscode-spring-bootpluginlogs enable
vmware.vscode-spring-bootpluginredhat.java plugin syntax server log:
martinlippert commentedon Jan 23, 2025
@CloudSen Thanks for updating this issue with all the details, much appreciated. I have a few questions:
CloudSen commentedon Jan 24, 2025
Thank you for your reply! Below are my answers to your questions:
Yes, this issue is 100% reproducible in a specific project, but it works fine in other projects
I have tried switching to the pre-release version, but the issue persists. However, the progress is no longer stuck at 0% but at 78%.
With my project, it should get stuck at:
I have uploaded a project that can reproduce the issue: https://github.com/CloudSen/vscode_java_build_hang_demo.
And this is my vscode profile: https://gist.github.com/CloudSen/f2605bfc5e6cbc381f1393915e9d921e
Sorry, I currently do not have any Gradle projects. All my projects are Maven-based
Hope the above info helps!
martinlippert commentedon Jan 24, 2025
Thanks @CloudSen for the additional details. Unfortunately I am having difficulties building your sample project even outside of VSCode, running
mvn clean packagefrom the root directly results in various build errors. Do you have a few steps at hand how to setup and build the project from scratch?CloudSen commentedon Jan 24, 2025
Sry, I forgot to check the project's usability earlier. Now I've cleaned up the useless code and Maven dependencies.
What's more important is that this time, I'm on Windows 11, using the same VSCode profile to modify the demo project, and it still gets stuck during the "Searching" process.
Here are the steps to build the project:
cisdi-datakits-dependenciesdirectory, then runmvn clean installmvn clean package -Dmaven.test.skipmartinlippert commentedon Jan 27, 2025
Thanks @CloudSen for the additional details and the cleanup work, much appreciated. I can successfully build and import the project now, and I can reproduce the issue. The Java indexing is stuck around 78%... 👍
For the technical analysis:
The underlying thread dump of the Java language server show something like this
and several other threads trying to use the index at the same time, many looking like this:
I am not exactly sure why those calls cause the index to get stuck, but this is the piece where we need to investigate this in more detail, I think.
It also looks to me like disabling the
Spring Boot Dashboardextension works around this issue. At least that made this work for me and I only lost theSpring Boot Dashboardfunctionality, not everything from the Spring Tools. Can you verify that this works for you, too, @CloudSen ?martinlippert commentedon Jan 27, 2025
For the deeper investigation into the underlying issue, I filed microsoft/vscode-spring-boot-dashboard#352 for the dashboard project.
CloudSen commentedon Jan 27, 2025
CloudSen commentedon Jan 27, 2025
martinlippert commentedon Jan 27, 2025
That is good news!!! 👍
Yeah, no worries, this is totally not obvious from the outside... 😂