You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vscode ext causes "Header must provide a Content-Length property" continuously #968
Describe the bug
'to go defined' and 'code completion' fails. Developer Tools console continues to report errors "Header must provide a Content-Length property"
Write some code that will cause the Java language server reports error(for example: call a function with invaid arguement), then the error is likely to be reproduced.
These issues are usually related to the logging setup on the JVM... Can you check if JVM you are using to launch spring boot ls is different from the JVM launching Java LS? spring-boot.ls.java.home property value and java.jdt.ls.java.home.
Ensure there are no java agents contributing to the log output etc...
The issue is that something in the JVM attempts to write something to the output stream of the Spring Boot LS java process. The output stream of that process is used to send messages from the LS to the IDE client. Therefore IDE client throws an error that there is something unexpected found in the output stream.
I didn't change neither spring-boot.ls.java.home nor java.jdt.ls.java.home so both of them should stay default.
I can comfirm that this issue only happens when I upgrade vscode-spring-boot to v1.44.0.
I did tweak java.jdt.ls.vmargs on memory options.I'll fllow the vscode-java issue to do more tweaks.Thanks for replying, this issue should be closed if it work.
@ZinkLu do you recall what you were doing in VSCode at the moment of the error? Which editor you were working with?
Lets try to determine which LSP messages causes this error assuming it is some particular message... hopefully...
Open VSCode settings.json and add "vscode-spring-boot.trace.server": "verbose" to it.
Reload the Window or re-start VSCode
Activate Output tab at the bottom and select vscode-spring-boot-debug-log in the drop-down in the top-right corner of the view
Continue working with spring-boot extension. Once the "header content length" error occurs note the log and attach/paste the relevant part of it here please.
The issue is that OpenRewrite dependency has a System.out.println(...) statement executed while parsing a Java Source. Since standard in and out streams of the Language Server process are used for JSON RPC comm to the IDE client (VSCode) the sys out corrupts the comm data hence the error about header content length.
Activity
BoykoAlex commentedon Feb 3, 2023
These issues are usually related to the logging setup on the JVM... Can you check if JVM you are using to launch spring boot ls is different from the JVM launching Java LS?
spring-boot.ls.java.homeproperty value andjava.jdt.ls.java.home.Read through the issue below:
redhat-developer/vscode-java#2577
Ensure there are no java agents contributing to the log output etc...
The issue is that something in the JVM attempts to write something to the output stream of the Spring Boot LS java process. The output stream of that process is used to send messages from the LS to the IDE client. Therefore IDE client throws an error that there is something unexpected found in the output stream.
ZinkLu commentedon Feb 3, 2023
I didn't change neither
spring-boot.ls.java.homenorjava.jdt.ls.java.homeso both of them should stay default.I can comfirm that this issue only happens when I upgrade vscode-spring-boot to v1.44.0.
I did tweak
java.jdt.ls.vmargson memory options.I'll fllow the vscode-java issue to do more tweaks.Thanks for replying, this issue should be closed if it work.ZinkLu commentedon Feb 4, 2023
The errors were gone after adding
-Xlog:jni+resolve=offin "java.jdt.ls.vmargs" and "spring-boot.ls.java.vmargs".ZinkLu commentedon Feb 4, 2023
This error occurred again, I do not know what will trigger this error, I temporarily disabled the spring-boot-tools.
BoykoAlex commentedon Feb 6, 2023
@ZinkLu do you recall what you were doing in VSCode at the moment of the error? Which editor you were working with?
Lets try to determine which LSP messages causes this error assuming it is some particular message... hopefully...
settings.jsonand add"vscode-spring-boot.trace.server": "verbose"to it.Continue working with spring-boot extension. Once the "header content length" error occurs note the log and attach/paste the relevant part of it here please.
ZinkLu commentedon Feb 7, 2023
Hi @BoykoAlex, It's likely to reproduce the issue with following steps:
Here is my example:
Trace log whe the issue happen;
BoykoAlex commentedon Feb 7, 2023
The issue is that OpenRewrite dependency has a
System.out.println(...)statement executed while parsing a Java Source. Since standard in and out streams of the Language Server process are used for JSON RPC comm to the IDE client (VSCode) the sys out corrupts the comm data hence the error about header content length.Here is the fix for rewrite project: openrewrite/rewrite#2804
Once it is merged then spring-boot extension is built I'll post the download link to VSIX file to try and close the issue.
BoykoAlex commentedon Feb 8, 2023
Please try spring-boot extension VSIX (snapshot) at the bottom of the page: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html Should fix the issue.