vscode-java: Extension never activates, throwing error "Header must provide a Content-Length property"
As per the title, the extension never activates; the java language server status never switches to the thumbs-up. The extension runtime status shows 37 copies of the same uncaught error: Header must provide a Content-Length property.
The developer tools logs show the same error, slightly more verbosely:
workbench.desktop.main.js:2272 Error: Header must provide a Content-Length property.
at p.onData (c:\Users\Eric.Andrews\.vscode\extensions\redhat.java-1.8.0-win32-x64\dist\extension.js:2:1138205)
at Socket.<anonymous> (c:\Users\Eric.Andrews\.vscode\extensions\redhat.java-1.8.0-win32-x64\dist\extension.js:2:1137926)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
Environment
- Operating System: Windows 10 Enterprise (10.0.19044)
- JDK version: Eclipse Adoptium 17.0.3.7-hotspot
- Visual Studio Code version: 1.69.2
- Java extension version: 1.8.0
Steps To Reproduce
- Install jdk and VSCode
- Install the Extension Pack for Java
- Update settings.json to point to jdk:
"java.jdt.ls.java.home": "C:\\Program Files\\Eclipse Adoptium\\jdk-17.0.3.7-hotspot"
- Open any .java file
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Disable JVM logging by default. - Since any JVM component may invoke logging, it may be best to disable all logging - Related #2577 - Fixes #2292 Signed-off-by: Roland Grunberg <rgrunber@redhat.co... — committed to rgrunber/vscode-java by rgrunber 2 years ago
- Disable JVM logging by default. - Since any JVM component may invoke logging, it may be best to disable all logging - Related #2577 - Fixes #2292 Signed-off-by: Roland Grunberg <rgrunber@redhat.co... — committed to redhat-developer/vscode-java by rgrunber 2 years ago
In my case, adding
-Xlog:jni+resolve=off
tojava.jdt.ls.vmargs
solved this problem.languageclient has receiving rpc response with error messages as follows.
PanwHooks seems to be related to Palo Alto Networks products, which this product seems to injecting DLLs into the JVM.
I’m getting the same error. The workaround given by @muchida6 worked for me. @sudheerkkumar To add this config line you have to go to Setting and type
java.jdt.ls.vmargs
and clickEdit in settings.json
.