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

[coc.nvim] Language Support for Java client: couldn't create connection to server.

Open anta40 opened this issue 5 months ago • 3 comments

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

anta40 avatar Aug 02 '25 10:08 anta40

same for me too

kvreinzapp avatar Aug 14 '25 07:08 kvreinzapp

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

sify21 avatar Sep 02 '25 07:09 sify21

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.

doubledup avatar Sep 03 '25 09:09 doubledup