Extension never activates, throwing error "Header must provide a Content-Length property"
See original GitHub issueAs 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
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Why does my JavaScript code receive a "No 'Access-Control ...
I know that the API or remote resource must set the header, but why did it work when I made the request via...
Read more >5.x API - Express.js
Alterations to the headers must occur synchronously. ... When a callback function throws an error or returns a rejected promise, `next(err)` will be...
Read more >Request · Cloudflare Workers docs
This code snippet will throw during script startup, and the "fetch" event listener will never be registered. Set the Content-Length header.
Read more >API — Flask Documentation (2.2.x)
The idea of the first parameter is to give Flask an idea of what belongs to your application. ... The key must match...
Read more >Web on Servlet Stack - Spring
If you use XML-based Spring configuration, you should extend directly from ... are used to resolve exceptions thrown during request processing.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
.