Skip to content

GH2577: Add '-Xlog:jni+resolve=off' to the default vmargs - #2646

Merged
rgrunber merged 2 commits into
redhat-developer:masterfrom
testforstephen:jinbo_vmargs
Aug 26, 2022
Merged

rgrunber merged 2 commits into
redhat-developer:masterfrom
testforstephen:jinbo_vmargs

Conversation

@testforstephen

Copy link
Copy Markdown
Collaborator

Signed-off-by: Jinbo Wang [email protected]

Mitigate the issue #2577 (comment). The parameter -Xlog:jni+resolve=off is used to prevent some unexpected jni logs from being logged to stdout, because Java language server uses stdio as the jsonrpc channel by default.

@fbricon

fbricon commented Aug 25, 2022

Copy link
Copy Markdown
Collaborator

I think you should also add it dynamically if necessary (like we do for logging or jpms modules), in case user already uses custom VM args.

@testforstephen

Copy link
Copy Markdown
Collaborator Author

I think you should also add it dynamically if necessary (like we do for logging or jpms modules), in case user already uses custom VM args.

done.

@rgrunber rgrunber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. I did some quick research and noticed there's -Xlog:disable also. If the language server is communicating via std streams, there's probably a good argument to make for disabling logging completelyin the JVM when the client/server are using the standard streams, but maybe we can investigate that after.

It would be interesting to know if there's older issues with similar failure.

@rgrunber
rgrunber merged commit e53156d into redhat-developer:master Aug 26, 2022
@testforstephen
testforstephen deleted the jinbo_vmargs branch August 27, 2022 08:07
datho7561 pushed a commit to FieteO/vscode-java that referenced this pull request Sep 2, 2022
…eloper#2646)

* Add '-Xlog:jni+resolve' to vmargs dynamically

Signed-off-by: Jinbo Wang <[email protected]>
gayanper pushed a commit to gayanper/vscode-java that referenced this pull request Sep 8, 2022
…eloper#2646)

* Add '-Xlog:jni+resolve' to vmargs dynamically

Signed-off-by: Jinbo Wang <[email protected]>
@Aankhen

Aankhen commented Oct 23, 2022

Copy link
Copy Markdown

Looks fine to me. I did some quick research and noticed there's -Xlog:disable also.

Just wanted to note that this fixed the issue for me (Windows 10, VS Code 1.72.2, Java 17) when the other version didn’t.

@rgrunber

Copy link
Copy Markdown
Member

Looks fine to me. I did some quick research and noticed there's -Xlog:disable also.

Just wanted to note that this fixed the issue for me (Windows 10, VS Code 1.72.2, Java 17) when the other version didn’t.

This should be the default now. After discovering other issues that seemed very related to this, I thought there might be other JVM components that use the logging facility, so best to disable it entirely ( #2690 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension never activates, throwing error "Header must provide a Content-Length property"

4 participants