[coc.nvim] Language Support for Java client: couldn't create connection to server.
I'm using nvim 0.11.3 on macOS 15.5. coc-java is the latest version:
coc-java Current version 1.26.1 is up to date
After nvim is launched, greeted by this message:
[coc.nvim] Language Support for Java client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
The result is annoying: can't save file after updating (:wq). nvim hang. How to debug this?
I'm using openjdk 17.0.14 2025-01-21 LTS
same for me too
It's really weird, it only happens to me when I open files under certain directory, for example ~/Downloads. I can't save file either, the error is shown after vim hanging for 1 min
Error detected while processing BufWrite Autocommands for "*"..function <SNR>23_SyncAutocmd[4]..coc#rpc#reques
t[4]..<SNR>26_request[34]..BufWrite Autocommands for "*"..function <SNR>23_SyncAutocmd[4]..coc#rpc#request[4].
.<SNR>26_request:
line 29:
E605: Exception not caught: request CocAutocmd ['BufWritePre', 1, 'a.json', 3] timeout after 60s
I was caught by this today after things working yesterday. Only failed when opening nvim in a single directory. What fixed it for me was deleting the workspace for the offending directory. Take a look at ~/.config/coc/extensions/coc-java-data/: the directories there named like jdt_ws_*/ are the workspaces for JDT LS.
Check the modified times for the workspaces:
ls -Al jdt_ws*
And remove whichever workspace you think is associated with the offending directory:
rm -Rf jdt_ws_66010eebbf57bd66425b1739286b4e97/
Normally you can do this with :CocCommand java.clean.workspace, but if JDT LS is failing to start up due to issues in the workspace you'll need to manually delete the workspace.