question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Corrupted workspace state on restart

See original GitHub issue

Every so often, when I close VS Code and I open it again later to continue working on the project, the Java Language Server (or some part of this extension) gets a corrupted build state. All my Java files get red-lined everywhere especially with imports (which should have been resolved correctly through Maven dependencies). It makes the entire Java project riddled with errors, when there should be 0 errors reported.

The workspace log file reports: message: The project was not built since the source file /jdt.ls-java-project/src/com/example/package/SampleClass-6b2da599__18012WV3rlaskH3xV.java could not be read;code: 0

It looks like some kind of weird diff version of the original class file (perhaps generated from all the diffing I do while I work on my project. Looks like JLS thinks the diff file is an actual project file and keeps looking for it?

I tried to look inside this jdt.ls-java-project folder but I have no idea what’s wrong. The file doesn’t exist. I don’t know how to fix this or how to force refresh JLS cache (if there’s such a thing). Any hints and pointers will be very helpful. This is the second time I am getting this problem; I don’t remember how I fixed it the first time or it just fixed itself somehow.

Environment
  • Operating System: Windows 10 x64
  • JDK version: 1.8.0_144
  • Visual Studio Code version: 1.18.1
  • Java extension version: 0.15.0
Steps To Reproduce

I’m not really sure. It just randomly happens when I close VS Code and open it later again.

Current Result

Weird build errors resulting in red-lining throughout the project.

Expected Result

Successfully built project every time.

Additional Information

None.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:32 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
fbriconcommented, Feb 14, 2018

@MattJakeman I can’t investigate further until I manage to reproduce the issue. Until then, the best remedy is to delete the vscode workspace directory and try again

1reaction
gitorkocommented, May 15, 2018

Never mind got it C:\Users\USERNAME\AppData\Roaming\Code\User\workspaceStorage

https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting#clean-the-workspace-directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot a WorkSpace stuck in starting, rebooting, or ...
If a reboot command is sent to the WorkSpace from the console or client application, then the WorkSpace might be busy applying updates....
Read more >
How to recover corrupted Eclipse workspace? - Stack Overflow
Back up the corrupted workspace. Move half of you projects to some temporary location. Start Eclipse, if it works, go to step 5....
Read more >
Possible workspace corruption resulting "Unable to read ... - IBM
... Application Developer for WebSphere Software results in the error "Unable to read workbench state, workbench UI layout will be reset."
Read more >
Restoring a Corrupted Workspace in Eclipse - Dark Views
Start Eclipse, wait for all builds and background activity to stop and then kill it using your OS' tools. When Eclipse restarts, it...
Read more >
482735 – Repeatable workspace corruption - Bugs - Eclipse
I'm seeing a repeatable situation that corrupts my Eclipse workspace on one ... or even reboot the VM, but once a workspace gets...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found