Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build the maven project after upgrading to the latest release version. #3926

Open
CloudSen opened this issue Jan 23, 2025 · 11 comments
Assignees

Comments

@CloudSen
Copy link

CloudSen commented Jan 23, 2025

Environment Information

OS: MACOS 15.2 (24C101) M1
IDE Version: VSCODE 1.96.4
Plugin Version: 1.39.0 (January 22nd, 2025)
User Config:

"java.jdt.ls.java.home": "/Users/clouds3n/.sdkman/candidates/java/21.0.2-zulu",
    "java.autobuild.enabled": false,
    "java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "/Users/clouds3n/.sdkman/candidates/java/8.0.402-zulu",
            "default": true
        },
        {
            "name": "JavaSE-17",
            "path": "/Users/clouds3n/.sdkman/candidates/java/17.0.12.fx-zulu"
        },
        {
            "name": "JavaSE-21",
            "path": "/Users/clouds3n/.sdkman/candidates/java/21.0.2-zulu"
        }
    ],
    "redhat.telemetry.enabled": false,

What Happend

When I open the project, the build always gets stuck at:

90014eca Repository registry initialization [Done]
c9f159a9 Importing Maven project(s) [Done]
e4d5e13e Send Classpath Notifications [Done]
b18b1e41 Refreshing workspace [Done]
3296788a Validate documents [Done]
5a6a8360 Publish Diagnostics [Done]
eefe1760 Searching... - 0% 

I tried running Java: Clean Java Language Server Workspace and mvn clean, and even reinstalled the plugin, but none of it worked.

LOG

plugin log:

WARNING: Using incubator modules: jdk.incubator.vector
1月 23, 2025 2:34:43 下午 org.apache.aries.spifly.BaseActivator log
信息: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
1月 23, 2025 2:34:43 下午 org.apache.aries.spifly.BaseActivator log
信息: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
1月 23, 2025 2:34:46 下午 com.microsoft.java.debug.plugin.internal.JavaDebuggerServerPlugin start
信息: Starting com.microsoft.java.debug.plugin

plugin syntax server log:

WARNING: Using incubator modules: jdk.incubator.vector
[Error - 14:34:44] 2025年1月23日 14:34:44 An internal error occurred during: "Initialize After Load".
Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundle(BundleUtils.java:360)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin$1.run(JavaLanguageServerPlugin.java:196)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)


@CloudSen
Copy link
Author

!ENTRY org.springframework.tooling.jdt.ls.extension 4 0 2025-01-23 15:20:17.296
!MESSAGE Cannot invoke "org.eclipse.m2e.core.internal.MavenPluginActivator.getMavenProjectManager()" because the return value of "org.eclipse.m2e.core.internal.MavenPluginActivator.getDefault()" is null
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.m2e.core.internal.MavenPluginActivator.getMavenProjectManager()" because the return value of "org.eclipse.m2e.core.internal.MavenPluginActivator.getDefault()" is null
	at org.eclipse.m2e.core.MavenPlugin.getMavenProjectRegistry(MavenPlugin.java:48)
	at org.springframework.tooling.jdt.ls.commons.classpath.ClasspathUtil.createProjectBuild(ClasspathUtil.java:252)
	at org.springframework.tooling.jdt.ls.commons.classpath.SendClasspathNotificationsJob.run(SendClasspathNotificationsJob.java:146)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.jdt.ls.core 4 2 2025-01-23 15:20:17.297
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager.getPreferences()" because "manager" is null
	at org.eclipse.jdt.ls.core.internal.ProjectUtils.isVisibleProject(ProjectUtils.java:305)
	at org.eclipse.jdt.ls.core.internal.ProjectUtils.isUnmanagedFolder(ProjectUtils.java:321)
	at org.eclipse.jdt.ls.core.internal.ProjectUtils.getProjectRealFolder(ProjectUtils.java:341)
	at com.microsoft.jdtls.ext.core.model.PackageNode.createNodeForProject(PackageNode.java:172)
	at com.microsoft.jdtls.ext.core.ProjectCommand.listProjects(ProjectCommand.java:125)
	at com.microsoft.jdtls.ext.core.CommandHandler.executeCommand(CommandHandler.java:27)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:610)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

@mrcatx
Copy link

mrcatx commented Jan 23, 2025

I have same issue, java publish diagnostics stuck at 0%

ad9caec0 Building [Done]
37f178a5 Building [Done]
9479ac5f Publish Diagnostics - 0%
d219cadd Validate documents - 0%
c9ecc369 Searching... - 0%

@CloudSen
Copy link
Author

I have same issue, java publish diagnostics stuck at 0%

ad9caec0 Building [Done] 37f178a5 Building [Done] 9479ac5f Publish Diagnostics - 0% d219cadd Validate documents - 0% c9ecc369 Searching... - 0%

I found a temporary solution.
If you guys installed vmware.vscode-spring-boot plugin, just disable it, then everything works fine!
read more : [Spring Boot Tools Plugin Causes Java Searching to Hang in Large Projects (3300 Java Files)
#1419](spring-projects/sts4#1419 (comment))

@mrcatx
Copy link

mrcatx commented Jan 23, 2025

I have same issue, java publish diagnostics stuck at 0%
ad9caec0 Building [Done] 37f178a5 Building [Done] 9479ac5f Publish Diagnostics - 0% d219cadd Validate documents - 0% c9ecc369 Searching... - 0%

I found a temporary solution. If you guys installed vmware.vscode-spring-boot plugin, just disable it, then everything works fine! read more : [Spring Boot Tools Plugin Causes Java Searching to Hang in Large Projects (3300 Java Files) #1419](spring-projects/sts4#1419 (comment))

Switch to pre-release version can solve the problem.

@rgrunber
Copy link
Member

First error reported seems to happen at https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/fdced4b93a1b9fb37b599581376d26af4c049e5e/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaLanguageServerPlugin.java#L196 and implies the Buildship bundle didn't start correctly . Second error seems to imply the M2E integration didn't start correctly. @snjeza , could the above plugin really be causing this ?

@snjeza
Copy link
Contributor

snjeza commented Jan 23, 2025

... and implies the Buildship bundle didn't start correctly . Second error seems to imply the M2E integration didn't start correctly. @snjeza , could the above plugin really be causing this ?

@rgrunber You are right. I am trying to reproduce the problem

@snjeza snjeza self-assigned this Jan 23, 2025
@rgrunber
Copy link
Member

I saw this in my logs. I was opening the lemminx project and hitting completion in XMLLanguageServer.java prior to it fully loading. Not sure if that had anything to do with it.

stacktrace
[Trace - 15:36:14] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Jan 23, 2025, 3:36:14 p.m. class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started"
}


[Info  - 15:36:14] Jan 23, 2025, 3:36:14 p.m. class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started
[Trace - 15:36:14] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Jan 23, 2025, 3:36:14 p.m. Starting org.eclipse.buildship.core"
}


[Info  - 15:36:14] Jan 23, 2025, 3:36:14 p.m. Starting org.eclipse.buildship.core
[Trace - 15:36:14] Received notification 'window/logMessage'.
Params: {
    "type": 1,
    "message": "Jan 23, 2025, 3:36:14 p.m. An internal error occurred during: \"Initialize After Load\".\nCannot invoke \"org.osgi.framework.Bundle.start(int)\" because the return value of \"org.eclipse.core.runtime.Platform.getBundle(String)\" is null\njava.lang.NullPointerException: Cannot invoke \"org.osgi.framework.Bundle.start(int)\" because the return value of \"org.eclipse.core.runtime.Platform.getBundle(String)\" is null\n\tat org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundle(BundleUtils.java:360)\n\tat org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin$1.run(JavaLanguageServerPlugin.java:196)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\n"
}


[Error - 15:36:14] Jan 23, 2025, 3:36:14 p.m. An internal error occurred during: "Initialize After Load".
Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
java.lang.NullPointerException: Cannot invoke "org.osgi.framework.Bundle.start(int)" because the return value of "org.eclipse.core.runtime.Platform.getBundle(String)" is null
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundle(BundleUtils.java:360)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin$1.run(JavaLanguageServerPlugin.java:196)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

[Trace - 15:36:14] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "Jan 23, 2025, 3:36:14 p.m. Main thread is waiting"
}

@rgrunber rgrunber added this to the End February 2025 milestone Jan 23, 2025
@snjeza
Copy link
Contributor

snjeza commented Jan 23, 2025

@rgrunber Do you use Eclipse PDE support?

@CloudSen
Copy link
Author

I have same issue, java publish diagnostics stuck at 0%
ad9caec0 Building [Done] 37f178a5 Building [Done] 9479ac5f Publish Diagnostics - 0% d219cadd Validate documents - 0% c9ecc369 Searching... - 0%

I found a temporary solution. If you guys installed vmware.vscode-spring-boot plugin, just disable it, then everything works fine! read more : [Spring Boot Tools Plugin Causes Java Searching to Hang in Large Projects (3300 Java Files) #1419](spring-projects/sts4#1419 (comment))

Switch to pre-release version can solve the problem.

No, this doesn't work for me. I upgraded the plugin to the pre-release version, and it always gets stuck at 78% during the loading process:

b7ec3f02 LookupJDKToolchainsJob [Done]
fcccb8fa Resolve plugin dependency [Done]
54c0a1ac Send Classpath Notifications [Done]
9104ef15 Refreshing workspace [Done]
85c51b07 Searching... - 78% 528 files to index (/cisdi-datakits-cache-abs)

@CloudSen
Copy link
Author

First error reported seems to happen at https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/fdced4b93a1b9fb37b599581376d26af4c049e5e/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaLanguageServerPlugin.java#L196 and implies the Buildship bundle didn't start correctly . Second error seems to imply the M2E integration didn't start correctly. @snjeza , could the above plugin really be causing this ?

I’d like to add some more info.
I’m not sure if this issue should be reported here—it seems like it might be caused by the Spring Boot Tools plugin.

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

  1. this issue is 100% reproducible in a specific project, but it works fine in other projects

  2. 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%.

  • redhat.java plugin => pre-release & vmware.vscode-spring-boot => release: The issue still exists.

  • redhat.java plugin => release & vmware.vscode-spring-boot => pre-release: The issue still exists.

  • redhat.java plugin => pre-release & vmware.vscode-spring-boot => pre-release: The issue still exists.

  • redhat.java plugin => release & vmware.vscode-spring-boot => disabled: The issue resolved.

With my project, it should get stuck at:

c1d4bdec LookupJDKToolchainsJob [Done]  
1f266fc0 Resolve plugin dependency [Done]  
72c92888 Send Classpath Notifications [Done]  
837d46f6 Send Classpath Notifications [Done]  
fd9a4f15 Refreshing workspace [Done]  
48870b37 Searching... - 78% 519 files to index (/cisdi-datakits-cache-abs)  

Hope the info above is helpful.

@CloudSen
Copy link
Author

First error reported seems to happen at https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/fdced4b93a1b9fb37b599581376d26af4c049e5e/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaLanguageServerPlugin.java#L196 and implies the Buildship bundle didn't start correctly . Second error seems to imply the M2E integration didn't start correctly. @snjeza , could the above plugin really be causing this ?

I’d like to add some more info. I’m not sure if this issue should be reported here—it seems like it might be caused by the Spring Boot Tools plugin.

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

  1. this issue is 100% reproducible in a specific project, but it works fine in other projects
  2. 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%.
  • redhat.java plugin => pre-release & vmware.vscode-spring-boot => release: The issue still exists.
  • redhat.java plugin => release & vmware.vscode-spring-boot => pre-release: The issue still exists.
  • redhat.java plugin => pre-release & vmware.vscode-spring-boot => pre-release: The issue still exists.
  • redhat.java plugin => release & vmware.vscode-spring-boot => disabled: The issue resolved.

With my project, it should get stuck at:

c1d4bdec LookupJDKToolchainsJob [Done]  
1f266fc0 Resolve plugin dependency [Done]  
72c92888 Send Classpath Notifications [Done]  
837d46f6 Send Classpath Notifications [Done]  
fd9a4f15 Refreshing workspace [Done]  
48870b37 Searching... - 78% 519 files to index (/cisdi-datakits-cache-abs)  

Hope the info above is helpful.

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:

  • use jdk8
  • Go to the cisdi-datakits-dependencies directory, then run mvn clean install
  • Go back to the root directory
  • Run mvn clean package -Dmaven.test.skip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants