Fork me on GitHub

This is not about Chlorine per se, but I am experiencing an issue starting a socket REPL using lein 2.9.1 (and also tested 2.9.4). I have this in my ~/.lein/profiles.clj

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


I start the socket repl with lein with-profile +socket repl


But, I am getting an nREPL that starts up


nREPL server started on port 53093 on host - 
REPL-y 0.4.4, nREPL 0.7.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 11.0.4+11-LTS
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e


If I put something wrong in my profile then lein repl errors out, so I know my profile is being read. In this case, I am not seeing any errors, just getting an nREPL starting instead of the socket REPL I need for Chlorine.


This successfully starts a socket REPL: clojure -J-Dclojure.server.myrepl="{:port 50505, :accept,clojure.core.server/repl}"


But then I do not have the benefits of lein adding the source path and whatnot to what is otherwise lein-based development.


I am hoping someone can offer some tips on how to diagnose this.


@jhemann What makes you think the Socket REPL is not being started with Leiningen?


Seeing the nREPL and the port being 53093. Maybe I am being dense though, and lein is starting an nREPL but also a socket REPL on the port I chose, 50505? Let me check...


lein repl always starts an nREPL server and that port number is for nREPL.


OK, false alarm. There is a socket REPL on 50505. I was thrown off by seeing the nREPL always starting. Thanks for the quick response @seancorfield.


The Socket REPL is started by Clojure, because of the JVM option -- Leiningen and nREPL know nothing about it.


(one thing to be aware of: if you start lein with-profile +socket repl outside a project, it seems to only start one JVM and therefore it does not pick up the additional JVM options from the profile)


(and that's one more reason that I'm glad I stopped using Leiningen back in 2015! 🙂 )