redhat-developer / redhat-developer/vscode-java

Language server shuts down when attempting to use intellisense

Open
#3,254 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I'm running VS Code in a devcontainer, using Colima as the container runtime. Host operating system is MacOS X Ventura 13.5.1, container operating system is Ubuntu 22.04.2 LTS.

I've installed the vscode-java extension using the java devcontainer feature. It's running v1.21.0.

In my environment I have additionally installed IBM Semeru 11.0.20 and 8.0.382. The java language server is configured to use the embedded 17.0.7-linux-x86_64 JRE, and I've specified that explicitly in the java.jdt.ls.java.home setting to attempt to work around this issue.

When clicking around the UI when editing java (e.g. triggering intellisense in a source file) I experience restarts of the language server, where intellisense options disappear, and problems disappear from the problems view. I figure after a while the language server is restarted and I can see intellisense options again.

I've enabled "java.trace.server": "verbose" and consulted the referenced logs in the messages and troubleshooting guides. Here are the relevant excerpts:

From output -> Language Support for java:

[Error - 10:12:10 PM] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Trace - 10:12:10 PM] Sending request 'shutdown - (16)'.
[Error - 10:12:10 PM] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 10:12:10 PM] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 10:12:10 PM] Client Language Support for Java: connection to server is erroring. Shutting down server.

From output -> VS Intellicode:

Error while activating Java: {"code":-32096}. If vscode-java failed to activate, try these troubleshooting steps: https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting

From F1 -> Developer: Toggle developer tools:

log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project1.../src/test/java, recursive: true, session: 0.4090436531869104): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project1.../src/test/java'
23:09:41.197 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project1.../src/test/resources, recursive: true, session: 0.18483316311899056): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project1.../src/test/resources'
23:09:41.197 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project2.../src/test/java, recursive: true, session: 0.6391248733455004): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project2.../src/test/java'
23:09:41.197 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project1.../target/generated-test-sources/test-annotations, recursive: true, session: 0.54014239349779): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project1.../target/generated-test-sources/test-annotations'
23:09:41.198 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project2.../target/generated-test-sources/test-annotations, recursive: true, session: 0.10929634161612789): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project2.../target/generated-test-sources/test-annotations'
23:09:41.198 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project3.../src/test/java, recursive: true, session: 0.9882082292151408): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project3.../src/test/java'
23:09:41.198 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project3.../target/generated-test-sources/test-annotations, recursive: true, session: 0.06354674384256787): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project3.../target/generated-test-sources/test-annotations'
23:09:41.198 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project3.../src/test/resources'
23:09:41.198 log.ts:441 ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: ...project3.../src/test/resources, recursive: true, session: 0.5705465953000592): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat '...project2.../src/test/resources'

None of that looked particularly interesting. All I could tell was that there was some kind of error associated with the language server connection, and that it was shut down. I do experience this quite frequently and repeatedly, but it is intermittent, there doesn't seem to be a specific activity that triggers it. Doubtless it's something to do with the complexity of running everything in a devcontainer.

Any hints where I might find some log with more details of specifically what went wrong with the connection to the language server?

Environment
  • Operating System: Mac OS X Ventura 13.5.1
  • JDK version: 17.0.7-linux-x86_64
  • Visual Studio Code version: 1.81.1
  • Java extension version: v1.21.0
Steps To Reproduce
  1. Run java extension in a devcontainer
  2. import maven projects automatically on startup
  3. open a java source file in an imported project and trigger intellisense
  4. problems view intermittently clears and intellisense stops working until the language server restarts itself

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Language Support for Java output using java.trace.server set to verbose, then compare it with the VS Code Developer Tools errors and the reported file-watcher paths. The issue is complete when the intermittent language-server shutdown can be reproduced or its cause identified with actionable evidence; no repository file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.