Open buddywhitman opened 2 years ago
Pleeease help me fix this ASAP. Doing this for a high school project ):
Just for the sake of a workaround, does the problem still persist if you uninstall vscode-java-dependency
(Project Manager for Java) or vscode-java-debug
(Debugger for Java)
) ? A similar error is in https://github.com/microsoft/vscode-java-debug/issues/915
have you tried using a vanilla JDK like openJDK or the like? I had the same issue when I was using a non default JDK like DCEVM or any other patched JVM
i have same issue , this log :
[2022-03-03 10:03:54.115] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2022-03-03 10:03:54.913] [exthost] [warning] [redhat.java] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource.
[2022-03-03 10:03:54.991] [exthost] [error] TypeError: Cannot read property 'sendRequest' of undefined
at path\redhat.java-1.3.0\dist\extension.js:2:795128
I have same issue.
I uninstalled all extensions in Extension Pack for Java, and installed only this Language Support for Java, but not fixed ;(.
this log :
[2022-03-05 10:41:43.846] [exthost] [warning] [redhat.java] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource.
[2022-03-05 10:41:43.406] [exthost] [error] TypeError: Cannot read property 'sendRequest' of undefined
at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:672066
at f._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:30255)
at f._doExecuteCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:29143)
at f._doExecuteCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:29817)
at processTicksAndRejections (internal/process/task_queues.js:93:5) java.execute.workspaceCommand {"value":"redhat.java","_lower":"redhat.java"}
...
[2022-03-05 11:05:37.123] [exthost] [error] [redhat.java] provider FAILED
[2022-03-05 11:05:37.123] [exthost] [error] Error: The request (id: 1193, method: 'textDocument/hover') has been cancelled
at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983104
at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983398
at Immediate.<anonymous> (~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983763)
at processImmediate (internal/timers.js:461:21)
I have same issue.
I uninstalled all extensions in Extension Pack for Java, and installed only this Language Support for Java, but not fixed ;(.
this log :
[2022-03-05 10:41:43.846] [exthost] [warning] [redhat.java] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource. [2022-03-05 10:41:43.406] [exthost] [error] TypeError: Cannot read property 'sendRequest' of undefined at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:672066 at f._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:30255) at f._doExecuteCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:29143) at f._doExecuteCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:85:29817) at processTicksAndRejections (internal/process/task_queues.js:93:5) java.execute.workspaceCommand {"value":"redhat.java","_lower":"redhat.java"} ... [2022-03-05 11:05:37.123] [exthost] [error] [redhat.java] provider FAILED [2022-03-05 11:05:37.123] [exthost] [error] Error: The request (id: 1193, method: 'textDocument/hover') has been cancelled at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983104 at ~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983398 at Immediate.<anonymous> (~/.vscode/extensions/redhat.java-1.4.0/dist/extension.js:2:983763) at processImmediate (internal/timers.js:461:21)
hey,man,we have the same issue.
i solve my question, i download latest file of .visx from this repo.
use
code --install-extension [value].visx
after open vscode , fix this question .
at the sametime i check the exthost.log
, the error message[cannot read property sendrequest] still exist.
hope this way can help .
@rgrunber yes, I tried uninstalling the vs code java dependency and the debugger but I remember encountering another error, after which I reinstalled the dependencies.
@liechtir I also use the OpenJDK and I encountered the same problem as with the Oracle JDK.
Thank you for your prompt replies everyone! Sorry for being late, just moved on to a new grade and I only opened GitHub today. @xingzhuimeteorite thank you for your solution, unfortunately I am still encountering the error.
CRUCIAL INFO: I have observed that this error is only encountered when I am creating a new class inside a pre-existing project (associated with the new Project Manager for Java), creating an independent class file in a new window results in smooth execution. Hope this helps the contributors!
i have not solved it, and i have tried my times but failed , i`m really sad (crying).
@HikiMaji share your settings.json
My common solution is to specify JDK17, and then delete the jvm startup parameters java.jdt.ls.vmargs
(prone to hidden errors that the parameters are not supported)
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "C:/Program Files/RedHat/java-17-openjdk-17.0.1.0.12-1",
"default": true
}
],
The general case is that the specified garbage collector causes this error. E.g -XX:+UseZGC
The first thing I noticed from trying this out is that the lombok jar location is still passed to -javaagent
even after uninstalling. On my machine, uninstalling doesn't remove the installed extension location, so there's no error, but it doesn't still launch with lombok embedded. That definitely seems like a bug on the end of vscode-lombok. If there's a way to detect an uninstall, it really should remove itself from the flag.
However, I'm not able to reproduce a crash. As @mozhuanzuojing mentions, it may be worth deleting your java.jdt.ls.vmargs
setting (or setting it as empty), to ensure just the defaults are used
I'm having the same issue. It started ~4 weeks ago with some update. After some time developing I cannot click on any reference to directly jump to it. I noticed iddferent error messages like Unable to load IDecompiler class for jarFileContentProvider
or redhat.java language server crashed
. Enabling and disabling different plugins and reinstalling vscode didn't solve the issue. I noticed that I'm not able to completly disable the java.jdt.ls.vmargs
option. It will get re-added by the lombok plugin after reload/restart (as described by @rgrunber).
Also there is this error in the logs: [exthost] [error] TypeError: s.logFailedRequest is not a function
Don't know if it is related.
Also a lot of this errors:
[2022-04-07 16:31:20.432] [exthost] [error] [redhat.java] provider FAILED
[2022-04-07 16:31:20.432] [exthost] [error] Error: Internal error.
at c:\Users\miraith\.vscode\extensions\redhat.java-1.4.0-win32-x64\dist\extension.js:2:983104
at c:\Users\miraith\.vscode\extensions\redhat.java-1.4.0-win32-x64\dist\extension.js:2:983398
at Immediate.<anonymous> (c:\Users\miraith\.vscode\extensions\redhat.java-1.4.0-win32-x64\dist\extension.js:2:983763)
at processImmediate (node:internal/timers:464:21)
I also installed the jar file's sources (described here https://github.com/redhat-developer/vscode-java/issues/2143#issuecomment-933741074).
Currently I'm trying the solution by @mozhuanzuojing and removed everything else added by default:
"java.jdt.ls.vmargs": "-XX:+UseZGC -javaagent:\"c:\\Users\\<user>\\.vscode\\extensions\\gabrielbb.vscode-lombok-1.0.1\\server\\lombok.jar\""
Seems this setting and/or the sources did the trick.
Edit: the issue still exists. It is really anoying. I'm thinking about switching over to IntelliJ
I have tried all the suggested solutions in previous threads - clearing java language workspace, reinstalling the extension pack, I didn't have vs-code lombok installed, so I actually went forward and installed it, only to uninstall it later and follow the steps referenced below (to restore java.jdt.ls.vmargs to its default value manually):
The problem is vscode-lombok adds a path to the lombok java agent in
java.jdt.ls.vmargs
, in the user settings.json. When you uninstall vscode-lombok, it doesn't clean up java.jdt.ls.vmargs, so that still references the lombok jar, which likely no longer exists:The language server then fails to start. See
So, after uninstalling vscode-lombok, one needs to manually remove the lombok java agent from the
java.jdt.ls.vmargs
preference.Originally posted by @fbricon in https://github.com/redhat-developer/vscode-java/issues/305#issuecomment-945083500
However, even after all this I am still getting the same error "Language Server restarted more than 5 times in the last 3 min. Not restarting again". Here are the logs for your reference:
Notable errors/exceptions: Unable to load IDecompiler class for jarFileContentProvider BadLocationException\n
{ message: 'Starting Java server with: c:\Users\user\.vscode\extensions\redhat.java-1.3.0\jre\17.0.1-win32-x86_64\bin\java --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.fs=ALL-UNNAMED -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Djava.import.generatesMetadataFilesAtProjectRoot=false -Dfile.encoding=utf8 -DwatchParentProcess=false -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=c:\Users\user\AppData\Roaming\Code\User\workspaceStorage\eec4092057407e1a5092d8492648964e\redhat.java -jar c:\Users\user\.vscode\extensions\redhat.java-1.3.0\server\plugins\org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar -configuration c:\Users\user\AppData\Roaming\Code\User\globalStorage\redhat.java\1.3.0\config_win -data c:\Users\user\AppData\Roaming\Code\User\workspaceStorage\eec4092057407e1a5092d8492648964e\redhat.java\jdt_ws', level: 'info', timestamp: '2022-02-24 09:05:17.077' } { message: '[Error - 9:10:26 am] 24-Feb-2022, 9:10:26 am Unable to load IDecompiler class for jarFileContentProvider', level: 'info', timestamp: '2022-02-24 09:10:26.576' } { message: '[Error - 9:16:10 am] 24-Feb-2022, 9:16:10 am BadLocationException\n' + 'null\n' + 'org.eclipse.jface.text.BadLocationException\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.fail(TreeLineTracker.java:1054)\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.lineByOffset(TreeLineTracker.java:268)\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.getLineNumberOfOffset(TreeLineTracker.java:1122)\r\n' + '\tat org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155)\r\n' + '\tat org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:872)\r\n' + '\tat org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:334)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:156)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:101)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:858)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:757)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:703)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getRange(DocumentSymbolHandler.java:205)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.toDocumentSymbol(DocumentSymbolHandler.java:172)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.lambda$2(DocumentSymbolHandler.java:147)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)\r\n' + '\tat java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getHierarchicalOutline(DocumentSymbolHandler.java:147)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.documentSymbol(DocumentSymbolHandler.java:80)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$14(JDTLanguageServer.java:636)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)\r\n' + '\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)\r\n', level: 'info', timestamp: '2022-02-24 09:16:10.461' } { message: '[Error - 9:16:10 am] 24-Feb-2022, 9:16:10 am BadLocationException\n' + 'null\n' + 'org.eclipse.jface.text.BadLocationException\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.fail(TreeLineTracker.java:1054)\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.lineByOffset(TreeLineTracker.java:268)\r\n' + '\tat org.eclipse.jface.text.TreeLineTracker.getLineNumberOfOffset(TreeLineTracker.java:1122)\r\n' + '\tat org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155)\r\n' + '\tat org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:872)\r\n' + '\tat org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:334)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:156)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:101)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:858)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:757)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toLocation(JDTUtils.java:703)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getRange(DocumentSymbolHandler.java:205)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.toDocumentSymbol(DocumentSymbolHandler.java:172)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.lambda$4(DocumentSymbolHandler.java:188)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)\r\n' + '\tat java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.toDocumentSymbol(DocumentSymbolHandler.java:190)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.lambda$2(DocumentSymbolHandler.java:147)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)\r\n' + '\tat java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)\r\n' + '\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)\r\n' + '\tat java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getHierarchicalOutline(DocumentSymbolHandler.java:147)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.documentSymbol(DocumentSymbolHandler.java:80)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$14(JDTLanguageServer.java:636)\r\n' + '\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75)\r\n' + '\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)\r\n' + '\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)\r\n', level: 'info', timestamp: '2022-02-24 09:16:10.469' } { message: "Failed to provide hover command Error: The request (id: 1436, method: 'java/findLinks') has been cancelled", level: 'error', timestamp: '2022-02-24 09:18:49.084' } { message: 'The Language Support for Java server crashed and will restart.', level: 'error', timestamp: '2022-02-24 09:21:33.702' } { message: '[Info - 9:21:33 am] Connection to server got closed. Server will restart.', level: 'info', timestamp: '2022-02-24 09:21:33.703' } { message: 'The Language Support for Java server crashed and will restart.', level: 'error', timestamp: '2022-02-24 09:21:36.007' } { message: '[Info - 9:21:36 am] Connection to server got closed. Server will restart.', level: 'info', timestamp: '2022-02-24 09:21:36.008' } { message: 'The Language Support for Java server crashed and will restart.', level: 'error', timestamp: '2022-02-24 09:21:36.560' } { message: '[Info - 9:21:36 am] Connection to server got closed. Server will restart.', level: 'info', timestamp: '2022-02-24 09:21:36.561' } { message: 'The Language Support for Java server crashed and will restart.', level: 'error', timestamp: '2022-02-24 09:21:36.600' } { message: '[Info - 9:21:36 am] Connection to server got closed. Server will restart.', level: 'info', timestamp: '2022-02-24 09:21:36.600' } { message: 'The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.', level: 'error', timestamp: '2022-02-24 09:21:36.629' } { message: '[Error - 9:21:36 am] Connection to server got closed. Server will not be restarted.', level: 'info', timestamp: '2022-02-24 09:21:36.630' }
Thanks for your support, buddywhitman