redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 440 forks source link

[error] [Extension Host] Error: Given URI does not belong to an existing Java source file. #3795

Open venkatkarnati1 opened 1 month ago

venkatkarnati1 commented 1 month ago

2024-10-02 16:13:20.410 [error] [Extension Host] Error: Given URI does not belong to an existing Java source file. at c:\Users\vekarnat.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:1090351 at re (c:\Users\vekarnat.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:1090645) at c:\Users\vekarnat.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:1085429 at Immediate. (c:\Users\vekarnat.vscode\extensions\redhat.java-1.35.1-win32-x64\dist\extension.js:2:1085449) at processImmediate (node:internal/timers:478:21)

Environment
Steps To Reproduce
  1. [step 1]
  2. [step 2]

[Please attach a sample project reproducing the error] Please attach logs

Current Result

Getting above error whenever java file is opened in editor even though file path is correct. When this error occurs, file symbols not populated in outline view.

Expected Result

This error should not come Symbols of file should populate in outline view.

Additional Informations
snjeza commented 1 month ago

@venkatkarnati1 could you attach a project example?

venkatkarnati1 commented 1 month ago

I can't attach project as this is client env project code. Find attached logs for your investigation. FYI. This error i got in client's VDI env.

venkatkarnati1 commented 1 month ago

Attached log file.

venkatkarnati1 commented 1 month ago

!ENTRY org.eclipse.jdt.ls.core 4 2 2024-10-03 16:40:07.047 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core". !STACK 1 org.eclipse.core.runtime.CoreException: Given URI does not belong to an existing Java source file. at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.isTestFile(ProjectCommand.java:458) at org.eclipse.jdt.ls.core.internal.JDTDelegateCommandHandler.executeCommand(JDTDelegateCommandHandler.java:115) 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:606) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) !SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2024-10-03 16:40:07.047 !MESSAGE Given URI does not belong to an existing Java source file. !SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2024-10-03 16:40:07.047 !MESSAGE Given URI does not belong to an existing Java source file.

!ENTRY org.eclipse.jdt.ls.core 4 0 2024-10-03 16:40:07.049 !MESSAGE Error in calling delegate command handler !STACK 1 org.eclipse.core.runtime.CoreException: Given URI does not belong to an existing Java source file. at org.eclipse.jdt.ls.core.internal.commands.ProjectCommand.isTestFile(ProjectCommand.java:458) at org.eclipse.jdt.ls.core.internal.JDTDelegateCommandHandler.executeCommand(JDTDelegateCommandHandler.java:115) 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:606) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) !SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2024-10-03 16:40:07.049 !MESSAGE Given URI does not belong to an existing Java source file.

snjeza commented 1 month ago

@venkatkarnati1 VS Code can't recognize your project. Could you show your workspace root path and your project's metadata: pom.xml, build.gradle/settings.gradle, .project, .classpath, .settings ...?

snjeza commented 1 month ago

FYI. This error i got in client's VDI env.

Could you reproduce the issue using standard VS Code?

venkatkarnati1 commented 1 month ago

FYI. This error i got in client's VDI env.

Could you reproduce the issue using standard VS Code?

I don't get this error outside VDI.

venkatkarnati1 commented 1 month ago

One more question. Is "Language Support for Java(TM) by Red Hat" extension is mandatory to get file symbols populated in Outline section in Explorer view in VS Code? If i don't use this extension, getting "No symbols found in document" in Outline section.

venkatkarnati1 commented 1 month ago

@venkatkarnati1 VS Code can't recognize your project. Could you show your workspace root path and your project's metadata: pom.xml, build.gradle/settings.gradle, .project, .classpath, .settings ...?

looks like issue with this specific project. Didn't get this error for other project.

snjeza commented 1 month ago

One more question. Is "Language Support for Java(TM) by Red Hat" extension is mandatory to get file symbols populated in Outline section in Explorer view in VS Code? If i don't use this extension, getting "No symbols found in document" in Outline section.

No, it isn't. Any extension can contribute to the Outline view. You can try opening a JSON or HTML file.

snjeza commented 1 month ago

I don't get this error outside VDI.

What VDI are you using?