docker

zendevil.eth 2022-02-23T12:18:07.516789Z

I’m running a clojure container with lein run in docker compose, and I have jvm-opts like so :jvm-opts ["-Dclojure.server.repl={:port,5555,:accept,clojure.core.server/repl}"] in project.clj. I’m trying to connec to the socket repl in atom using chlorine. But when I specify localhost and port 5555 I get the following:

REPL not connected
Connection refused. Ensure that you have a Socket REPL started on this host/port
How do I fix this error?

xsc 2022-02-23T13:03:21.948839Z

Check out this answer: https://stackoverflow.com/questions/36813690/connection-refused-on-docker-container It might have to do more with Docker than Clojure, so make sure you try the things described there first. 🙂

2022-02-23T13:25:41.955549Z

It could indeed be that the "host" need to be set to "0.0.0.0" so

lein repl :start :host 0.0.0.0 :port 12345

2022-02-23T13:26:33.802699Z

so you JVM options need to se something simialt.

2022-02-23T13:29:17.666899Z

Maybe :

:jvm-opts ["-Dclojure.server.repl={:port,5555,:address "0.0.0.0" ,:accept,clojure.core.server/repl}"]

zendevil.eth 2022-02-23T12:31:19.869679Z

getting a similar error when trying to connect with clover on vscode

zendevil.eth 2022-02-23T12:31:47.087209Z

REPL not connected: Unknown error while connecting to the REPL: -61

zendevil.eth 2022-02-23T12:56:08.193029Z

doesn’t seem to work on nvim either