vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Spring boot java gradle is a non-project file, only syntax errors are reported

Open jAlfredoCruz opened this issue 1 year ago • 7 comments

Spring boot with gradle have non-project file, only syntax errors are reported. But that error doesn't happen when you work with maven.

Environment
  • Operating System: Windows
  • JDK version: 21
  • Visual Studio Code version: 1.87
  • Java extension version: 1.28.1
Steps To Reproduce
  1. download spring with spring initializr
  2. unzip the spring project
  3. wait until the server start
  4. get the message java:Error
  5. in the package com.example.demo2 get the error non-project file, only syntax errors are reported

package com.example.demo2; // error: Demo2Application.java is a non-project file, only syntax errors are reported

import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication public class Demo2Application {

public static void main(String[] args) {
	SpringApplication.run(Demo2Application.class, args);
}

}

LOGS

ipse.buildId=unknown java.version=17.0.10 java.vendor=Eclipse Adoptium BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_MX Framework arguments: --stdio Command-line arguments: -data c:\Users\Admin\AppData\Roaming\Code\User\workspaceStorage\882f4e6a045482b784a5c5bc39d27f4c\redhat.java\jdt_ws --stdio

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:49:50.153 !MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:49:58.467 !MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:49:59.428 !MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:49:59.493 !MESSAGE Initializing Java Language Server 1.33.0.202402151519

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:49:59.514 !MESSAGE Started org.eclipse.m2e.core 1ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:09.881 !MESSAGE ProjectRegistryRefreshJob finished 10364ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:10.699 !MESSAGE Started org.eclipse.buildship.core 813ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:23.624 !MESSAGE Setting C:\Program Files\Java\jdk1.8.0_261 as 'JavaSE-1.8' environment (id:1709531412244)

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:23.675 !MESSAGE Setting C:\Program Files\Java\jdk-21.0.1 as 'JavaSE-21' environment (id:1709531423639)

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:23.683 !MESSAGE Setting java.home C:\Program Files\Java\jdk-21.0.1 as default global VM

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:23.832 !MESSAGE Default VM Install changed from 1709531411827-C:\Users\Admin.vscode\extensions\redhat.java-1.28.1-win32-x64\jre\17.0.10-win32-x86_64 to 1709531423639-C:\Program Files\Java\jdk-21.0.1

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:23.992 !MESSAGE JVM Runtimes changed, saving new configuration

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.212 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.214 !MESSAGE Non-Static Commands: [java.project.import, java.project.changeImportedProjects, java.navigate.openTypeHierarchy, java.project.resolveStackTraceLocation, java.edit.handlePasteEvent, java.edit.stringFormatting, java.project.getSettings, java.project.resolveWorkspaceSymbol, java.project.upgradeGradle, java.project.createModuleInfo, java.vm.getAllInstalls, java.edit.organizeImports, java.project.refreshDiagnostics, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.getAll, java.reloadBundles, java.project.isTestFile, java.project.resolveText, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.smartSemicolonDetection, java.project.updateSourceAttachment, java.project.updateClassPaths, java.decompile, java.protobuf.generateSources, java.project.resolveSourceAttachment, java.project.updateJdk, java.project.addToSourcePath, java.completion.onDidSelect]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.217 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.241 !MESSAGE Non-Static Commands: [java.intellicode.enable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.245 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.250 !MESSAGE Non-Static Commands: [vscode.java.test.findJavaProjects, vscode.java.test.findTestPackagesAndTypes, vscode.java.test.findTestTypesAndMethods, vscode.java.test.resolvePath, vscode.java.test.findTestLocation, vscode.java.test.get.testpath, vscode.java.test.findDirectTestChildrenForClass, vscode.java.test.navigateToTestOrTarget, vscode.java.test.junit.argument, vscode.java.test.generateTests]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.253 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.262 !MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.267 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.269 !MESSAGE Non-Static Commands: [vscode.java.checkProjectSettings, vscode.java.isOnClasspath, vscode.java.fetchUsageData, vscode.java.validateLaunchConfig, vscode.java.resolveInlineVariables, vscode.java.resolveClassFilters, vscode.java.resolveMainMethod, vscode.java.resolveClasspath, vscode.java.resolveBuildFiles, vscode.java.resolveMainClass, vscode.java.updateDebugSettings, vscode.java.resolveSourceUri, vscode.java.fetchPlatformSettings, vscode.java.buildWorkspace, vscode.java.startDebugSession, vscode.java.inferLaunchCommandLength, vscode.java.resolveElementAtSelection, vscode.java.resolveJavaExecutable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.279 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.283 !MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.checkImportStatus, java.project.list, java.project.generateJar, java.project.getMainClasses, java.getPackageData, java.resolvePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.432 !MESSAGE RepositoryRegistryUpdateJob finished 1ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.722 !MESSAGE Creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:24.761 !MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:50:26.461 !MESSAGE Finished creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 4 0 2024-03-03 23:51:23.694 !MESSAGE Initialization failed !STACK 0 java.util.concurrent.CompletionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: org.gradle.tooling.BuildException: Could not fetch model of type 'GradleSourceSets' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.5-bin.zip'. at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source) at com.microsoft.gradle.bs.importer.GradleBuildServerProjectImporter.importToWorkspace(GradleBuildServerProjectImporter.java:171) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:162) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:124) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:263) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: org.gradle.tooling.BuildException: Could not fetch model of type 'GradleSourceSets' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.5-bin.zip'. at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:24.007 !MESSAGE >> initialization job finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:24.113 !MESSAGE >> registerWatchers'

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:24.148 !MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:38.712 !MESSAGE Reconciled 1. Took 100 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:43.534 !MESSAGE begin problem for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:43.628 !MESSAGE 1 problems reported for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:45.984 !MESSAGE Validated 1. Took 6582 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-03 23:51:53.911 !MESSAGE >> build jobs finished

!ENTRY java-debug 1 0 2024-03-04 00:02:27.058 !MESSAGE Starting com.microsoft.java.debug.plugin

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:15:50.291 !MESSAGE >> java/validateDocument

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:15:54.189 !MESSAGE begin problem for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:15:54.192 !MESSAGE 1 problems reported for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:15:54.210 !MESSAGE Validated 1. Took 1339 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:16:36.070 !MESSAGE Clearing problems for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:17:29.055 !MESSAGE >> shutdown

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:17:29.090 !MESSAGE >> exit

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:17:29.390 !MESSAGE Shutdown received... waking up main thread

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 00:17:30.175 !MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is stopping: !SESSION 2024-03-04 11:25:14.631 ----------------------------------------------- eclipse.buildId=unknown java.version=17.0.10 java.vendor=Eclipse Adoptium BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_MX Framework arguments: --stdio Command-line arguments: -data c:\Users\Admin\AppData\Roaming\Code\User\workspaceStorage\882f4e6a045482b784a5c5bc39d27f4c\redhat.java\jdt_ws --stdio

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:27:52.889 !MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:09.917 !MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:11.988 !MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:12.018 !MESSAGE Initializing Java Language Server 1.33.0.202402151519

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:12.028 !MESSAGE Started org.eclipse.m2e.core 2ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:22.812 !MESSAGE ProjectRegistryRefreshJob finished 10781ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:24.388 !MESSAGE Started org.eclipse.buildship.core 1564ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.775 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.778 !MESSAGE Non-Static Commands: [java.project.import, java.project.changeImportedProjects, java.navigate.openTypeHierarchy, java.project.resolveStackTraceLocation, java.edit.handlePasteEvent, java.edit.stringFormatting, java.project.getSettings, java.project.resolveWorkspaceSymbol, java.project.upgradeGradle, java.project.createModuleInfo, java.vm.getAllInstalls, java.edit.organizeImports, java.project.refreshDiagnostics, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.getAll, java.reloadBundles, java.project.isTestFile, java.project.resolveText, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.smartSemicolonDetection, java.project.updateSourceAttachment, java.project.updateClassPaths, java.decompile, java.protobuf.generateSources, java.project.resolveSourceAttachment, java.project.updateJdk, java.project.addToSourcePath, java.completion.onDidSelect]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.786 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.789 !MESSAGE Non-Static Commands: [java.intellicode.enable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.803 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.876 !MESSAGE Non-Static Commands: [vscode.java.test.findJavaProjects, vscode.java.test.findTestPackagesAndTypes, vscode.java.test.findTestTypesAndMethods, vscode.java.test.resolvePath, vscode.java.test.findTestLocation, vscode.java.test.get.testpath, vscode.java.test.findDirectTestChildrenForClass, vscode.java.test.navigateToTestOrTarget, vscode.java.test.junit.argument, vscode.java.test.generateTests]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.888 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.895 !MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.907 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.925 !MESSAGE Non-Static Commands: [vscode.java.checkProjectSettings, vscode.java.isOnClasspath, vscode.java.fetchUsageData, vscode.java.validateLaunchConfig, vscode.java.resolveInlineVariables, vscode.java.resolveClassFilters, vscode.java.resolveMainMethod, vscode.java.resolveClasspath, vscode.java.resolveBuildFiles, vscode.java.resolveMainClass, vscode.java.updateDebugSettings, vscode.java.resolveSourceUri, vscode.java.fetchPlatformSettings, vscode.java.buildWorkspace, vscode.java.startDebugSession, vscode.java.inferLaunchCommandLength, vscode.java.resolveElementAtSelection, vscode.java.resolveJavaExecutable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.929 !MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:26.933 !MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.checkImportStatus, java.project.list, java.project.generateJar, java.project.getMainClasses, java.getPackageData, java.resolvePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:27.475 !MESSAGE RepositoryRegistryUpdateJob finished 1ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:28:27.842 !MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 4 0 2024-03-04 11:31:18.423 !MESSAGE Initialization failed !STACK 0 java.util.concurrent.CompletionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: org.gradle.tooling.BuildException: Could not fetch model of type 'GradleSourceSets' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.5-bin.zip'. at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source) at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source) at com.microsoft.gradle.bs.importer.GradleBuildServerProjectImporter.importToWorkspace(GradleBuildServerProjectImporter.java:171) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:162) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:124) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:263) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: org.gradle.tooling.BuildException: Could not fetch model of type 'GradleSourceSets' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-8.5-bin.zip'. at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:209) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:19.174 !MESSAGE >> initialization job finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:19.239 !MESSAGE >> registerWatchers'

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:19.322 !MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:27.068 !MESSAGE Reconciled 1. Took 9 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:29.640 !MESSAGE begin problem for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:29.808 !MESSAGE 1 problems reported for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:29.966 !MESSAGE Validated 1. Took 2284 ms

!ENTRY java-debug 1 0 2024-03-04 11:31:36.242 !MESSAGE Starting com.microsoft.java.debug.plugin

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 11:31:42.224 !MESSAGE >> build jobs finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:15:12.482 !MESSAGE Clearing problems for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:21:35.821 !MESSAGE Reconciled 1. Took 3 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:21:35.826 !MESSAGE >> java/validateDocument

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:21:40.580 !MESSAGE begin problem for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:21:40.583 !MESSAGE 1 problems reported for /Demo2Application.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-03-04 12:21:40.586 !MESSAGE Validated 1. Took 2062 ms

Current Result
Expected Result
Additional Informations

The error not ocurrs when you uses maven like a repository script

jAlfredoCruz avatar Mar 04 '24 18:03 jAlfredoCruz

@jAlfredoCruz Could you try the following

  • exit VS Code
  • remove <your_home>.cache\tooling
  • remove <your_home>.gradle\wrapper
  • cd <your_project_home>
  • remove .project, .classpath, .settings
  • start VS Code

snjeza avatar Mar 04 '24 19:03 snjeza

@jAlfredoCruz Could you try the following

* exit VS Code

* remove <your_home>.cache\tooling

* remove  <your_home>.gradle\wrapper

* cd <your_project_home>

* remove .project, .classpath, .settings

* start VS Code

Thanks for your help for the same error continues

jAlfredoCruz avatar Mar 24 '24 19:03 jAlfredoCruz

Seeing a similar issue. Does not occur in IntelliJ Idea.

ndlarsen avatar Apr 20 '24 23:04 ndlarsen

@ndlarsen Could you, please, attach a project example?

snjeza avatar Apr 21 '24 00:04 snjeza

@ndlarsen Could you, please, attach a project example?

@snjeza The project was a basic Spring Boot restful api setup with a single controller. The issue seemed to come and go randomly even though both a ./gradlew compileJava and ./gradlew bootRun worked fine. In addition to that, the java project manager refused to acknowledge the existence of the project after issuing a "Java: clean java language server workspace" (I realise this is likely not related to this extension). Out of frustration I deleted the entire setup before seeing your comment which is by no means helpful to you, I know, and I apologise for the noise I have created so far. Should I happen to reproduce the issue I will make sure to create a more helpful comment/bug report as well as attach a zip of the project.

ndlarsen avatar Apr 21 '24 16:04 ndlarsen

Same issue. VSCode, Jdk 1.21, Gradle. Backing the version down to 17 bypasses the issue.

kennyk65 avatar Jun 14 '24 01:06 kennyk65

Same issue, with maven. In maven builds OK. I've Just unzip the structure from spring inizializator

marcosastorgano avatar Oct 06 '24 09:10 marcosastorgano