eclipse-jdtls / eclipse.jdt.ls

Java language server
1.8k stars 400 forks source link

Can't import a Gradle project. #1789

Open YoEight opened 3 years ago

YoEight commented 3 years ago

Greetings,

I'm using JDT with neovim. I'm using JDT v1.1.2 and getting this exception from the server, sorry for the formatting. It's directly coming out of neovim LSP log file:

\norg.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\norg.eclipse.buildship.core.internal.ImportRootProjectException: org.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.run(ImportRootProjectOperation.java:53)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.runInToolingApi(DefaultGradleBuild.java:225)\n\tat org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:58)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338)\n\tat org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:39)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.run(DefaultGradleBuild.java:192)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:100)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:86)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.startSynchronization(GradleProjectImporter.java:258)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.importDir(GradleProjectImporter.java:147)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.lambda$0(GradleProjectImporter.java:124)\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1541)\n\tat java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.importToWorkspace(GradleProjectImporter.java:124)\n\tat org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:113)\n\tat org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:102)\n\tat org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:194)\n\tat org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\nCaused by: org.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.verifyNoWorkspaceRootIsImported(ImportRootProjectOperation.java:77)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.access$100(ImportRootProjectOperation.java:39)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation$1.run(ImportRootProjectOperation.java:67)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2333)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.runInWorkspace(ImportRootProjectOperation.java:58)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.run(ImportRootProjectOperation.java:51)\n\t... 19 more\n"
[ WARN ] 2021-06-01T15:47:37+0200 ] ...imrVWGB0/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:404 ]   "Jun 1, 2021, 3:47:37 PM Synchronize project EventStoreDB-Client-Java failed due to an error while importing the root project.\norg.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\norg.eclipse.buildship.core.internal.ImportRootProjectException: org.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.run(ImportRootProjectOperation.java:53)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.runInToolingApi(DefaultGradleBuild.java:225)\n\tat org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager$WorkspaceRunnableAdapter.run(DefaultToolingApiOperationManager.java:58)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2338)\n\tat org.eclipse.buildship.core.internal.operation.DefaultToolingApiOperationManager.run(DefaultToolingApiOperationManager.java:39)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild$SynchronizeOperation.run(DefaultGradleBuild.java:192)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:100)\n\tat org.eclipse.buildship.core.internal.DefaultGradleBuild.synchronize(DefaultGradleBuild.java:86)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.startSynchronization(GradleProjectImporter.java:258)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.importDir(GradleProjectImporter.java:147)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.lambda$0(GradleProjectImporter.java:124)\n\tat java.base/java.util.ArrayList.forEach(ArrayList.java:1541)\n\tat java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)\n\tat org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.importToWorkspace(GradleProjectImporter.java:124)\n\tat org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:113)\n\tat org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:102)\n\tat org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:194)\n\tat org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\nCaused by: org.eclipse.buildship.core.internal.UnsupportedConfigurationException: Project EventStoreDB-Client-Java location matches workspace root /home/yoeight/code/EventStoreDB-Client-Java\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.verifyNoWorkspaceRootIsImported(ImportRootProjectOperation.java:77)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.access$100(ImportRootProjectOperation.java:39)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation$1.run(ImportRootProjectOperation.java:67)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2313)\n\tat org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2333)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.runInWorkspace(ImportRootProjectOperation.java:58)\n\tat org.eclipse.buildship.core.internal.workspace.ImportRootProjectOperation.run(ImportRootProjectOperation.java:51)\n\t... 19 more\n"
[ WARN ] 2021-06-01T15:47:37+0200 ] ...imrVWGB0/usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:108 ]   "The language server jdtls triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless

The project I try to work on is: https://github.com/EventStore/EventStoreDB-Client-Java

Versions

Java 11 Gradle 6.7 Neovim 0.5 (nightly) JDT 1.1.2

Thanks for your help

snjeza commented 3 years ago

@YoEight could you attach your java-lsp.sh?