vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

BundleException: Unable to acquire the state change lock for the module: osgi.identity

Open KnewOne opened this issue 3 years ago • 8 comments

Exiting VSC leaves a java process that blocks workspaceStorage/redhat.java files leading to deadlock on the files, thus breaking any functionality until i terminate the process manually, delete the redhat.java folder and start vscode. Neither developer reload for the window, nor java clearnup works. The latter doesn't work due to the same lock on the files.

Environment
  • Operating System: Win 10 Home 22H2
  • JDK version: jdk-20.0.1.9-hotspot ( gradle is jdk-19.0.2.7-hotspot)((breaks even if both use jdk-19.0.2.7-hotspot))
  • Visual Studio Code version: 1.79.2
  • Java extension version: 1.20.0
Steps To Reproduce
  1. Enter a project, let it build
  2. Exit the vscode
  3. Re-enter the same project, it will not load

Cannot attach the project In terms of logs, it's always the same first error of a deadlock appearing instead of proper project firstlogmessage.txt

Current Result

The project doesn't load java and endlessly send messages of a deadlock of over 30000ms

Expected Result

Proper functionality

Additional Informations

KnewOne avatar Jul 06 '23 17:07 KnewOne

@IKnewOne Could you try to set

"java.jdt.ls.vmargs": "-DwatchParentProcess=false <your_jvmargs",

for instance,

"java.jdt.ls.vmargs": "-DwatchParentProcess=false -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx6G -Xms512m -Xlog:disable",
    

snjeza avatar Jul 06 '23 17:07 snjeza

"-DwatchParentProcess=false" didn't seem to fix it entirely, but it looks like the file isn't blocked anymore whenever i try to clean and reload java workspace via command or even when exiting the vscode. But the error rarely appears after a java workspace reload. At least from what i can tell

Changing java settings, which forced the reload with the new settings in place, seem to make the vscode behave until reload, even with the java clean workspace command, but it still fails after closing the vscode.

Overall, it kinda makes it better, but it's still manual fixing

KnewOne avatar Jul 06 '23 19:07 KnewOne

Enter a project, let it build

Are you sure the build is complete? Could you attach your log? - Enable Logging

snjeza avatar Jul 06 '23 19:07 snjeza

Here's a log with empty redhat.java first run with ample time to build, followed by vscode exit, followed by opening vscode a second time and a third time serverLog.txt

KnewOne avatar Jul 06 '23 21:07 KnewOne

Duplicate of #3032

KnewOne avatar Jul 06 '23 22:07 KnewOne

@snjeza This appears to be a regression in vscode-java 1.20.0. In previous versions, I had not noticed #3032, but as of vscode-java 1.20.0, the issue occurs 100% of the time for me when working on Gradle projects (given a few preconditions, see https://github.com/redhat-developer/vscode-java/issues/3032#issuecomment-1615349170 for more details).

Currently I have downgraded to vscode-java 1.19.0 as a workaround, because I'm working on Gradle projects, and this issue is very annoying as it basically forces you to run Java: Clean Java Language Server Workspace every time you start VSCode.

0dinD avatar Jul 07 '23 15:07 0dinD

@0dinD @IKnewOne Could you, please, test VS Code 1.22.0 ?

snjeza avatar Jul 13 '23 18:07 snjeza

@snjeza so far seems to work with no issues on reload/bad exit/etc. Lombok and warnings are not being nice for some reason, but i hope that's irrelevant to the current issue so this is probably a fixed issue now ( until, of course, it regresses again )

KnewOne avatar Jul 13 '23 19:07 KnewOne