Vscode-java-debug: Running the contributed command: 'java.execute.workspaceCommand' failed.

Created on 1 Mar 2021  路  10Comments  路  Source: microsoft/vscode-java-debug

I cannot run any code after installing the java extensions in the ide. Manually compiling with javac and running the resulting .class file works just fine and dandy.

Environment
  • Operating System: Windows 10
  • JDK version: OpenJDK 15.0.2.7
  • Visual Studio Code version: 1.53.2
  • Java extension version: Language Support for java by red hat v0.75.0
  • Java Debugger extension version: v0.31.0
Steps To Reproduce

I followed this: https://code.visualstudio.com/docs/java/java-tutorial up to the "Run the program" step in the 'Getting Started' doc in the ide itself and got the rror.

Literally copypasted the QuickStart class from the 'Getting Started' document in the ide.

Current Result

Nothing happens and I get the error "Running the contributed command: 'java.execute.workspaceCommand' failed."

Expected Result

The sample code should run.

Additional Informations
needs more info

Most helpful comment

Could you reload the VS Code window and try again?

All 10 comments

Could you reload the VS Code window and try again?

Please share your logs.

Output window:
Language Support for Java

Logs:
F1 -> Java: Open All Log Files

Dev Tools Console:
Help -> Toggle Developer Tools -> Console

Also getting this error

Please see logs below

Error: Running the contributed command: 'java.execute.workspaceCommand' failed. at S._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:106930) at async Object.syncServer (/Users/john.alade/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:1:81077) at async Object.refresh (/Users/john.alade/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:1:79786) at async Object.initialize (/Users/john.alade/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:1:77932) at async g (/Users/john.alade/.vscode/extensions/shengchen.vscode-checkstyle-1.4.0/dist/extension.js:29:20243) Error: Running the contributed command: 'java.execute.workspaceCommand' failed. at new AppInsightsAsyncCorrelatedErrorWrapper (/Users/john.alade/.vscode/extensions/qub.qub-xml-vscode-1.2.8/node_modules/applicationinsights/out/AutoCollection/CorrelationContextManager.js:172:18) at S._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:106930)

I too am getting this error. For those looking for a work around reverting back to version 0.77 the command works again.

Attached are my logs.
vscodelogs.zip

@JohnTheBeloved The exception you pasted is from shengchen.vscode-checkstyle extension, not related with Java debugger extension.

@KJNoonan I searched the keyword 'java.execute.workspaceCommand' in your logs, didn't find anything.

I'm seeing the same problem with version 0.79.0 and 0.79.1 of the "Language Support for Java" extension. Version 0.77 and 0.78 of the extension are fine.

Nothing relevant in the Language Support for Java output window or the Java log files.

The DevTools console, however, shows the following error:

/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:2131 [[object Object]]write after end
$onExtensionRuntimeError @ /usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:2131
/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:2131 Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (/usr/share/codium/resources/app/out/vs/code/electron-browser/workbench/_stream_writable.js:266)
    at Socket.Writable.write (/usr/share/codium/resources/app/out/vs/code/electron-browser/workbench/_stream_writable.js:315)
    at /home/eaking/.vscode-oss/extensions/redhat.java-0.79.0/dist/extension.js:2
    at new Promise (<anonymous>)
    at c.write (/home/eaking/.vscode-oss/extensions/redhat.java-0.79.0/dist/extension.js:2)
    at _.doWrite (/home/eaking/.vscode-oss/extensions/redhat.java-0.79.0/dist/extension.js:2)
    at /home/eaking/.vscode-oss/extensions/redhat.java-0.79.0/dist/extension.js:2
$onExtensionRuntimeError @ /usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:2131

@testforstephen Thanks for clearifying

This issue has been closed automatically because it needs more information and has not had recent activity. Please reach out if you have or find the answers we need so that we can investigate further.

@testforstephen

Hi, what additional information would be helpful? KJNoonan attached the requested logs and I confirmed the same "write after end" error in the DevTools console.

The "Running the contributed command: 'java.execute.workspaceCommand' failed." does not appear in the logs; it is a notification:

image

@eakst7 your issue is duplicated with https://github.com/redhat-developer/vscode-java/issues/1929.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

testforstephen picture testforstephen  路  4Comments

manastalukdar picture manastalukdar  路  7Comments

PG-practice picture PG-practice  路  3Comments

TheSinding picture TheSinding  路  6Comments

James-Oswald picture James-Oswald  路  3Comments