Fork me on GitHub
#clojure
<
2021-01-12
>
nezaj22:01:44

Hey team, lein + nrepl question (putting it here as I guess it relates to both, so am not sure if an individual channel makes sense) we are trying to set up drawbridge. When we try to connect to it, lein repl :connect We get the following error:

WARNING: update already refers to: #'clojure.core/update in namespace: clj-http.client, being replaced by: #'clj-http.client/update
clojure.lang.Compiler$CompilerException: Syntax error compiling new at (drawbridge/client.clj:36:5).
#:clojure.error{:phase :compile-syntax-check, :line 36, :column 5, :source "drawbridge/client.clj", :symbol new}
 at clojure.lang.Compiler.analyzeSeq (Compiler.java:7114)  
....

Caused by: java.lang.ClassNotFoundException: clojure.tools.nrepl.transport.FnTransport
 at java.net.URLClassLoader.findClass (URLClassLoader.java:435)
    clojure.lang.DynamicClassLoader.findClass (DynamicClassLoader.java:69)
    java.lang.ClassLoader.loadClass (ClassLoader.java:589)
    clojure.lang.DynamicClassLoader.loadClass (DynamicClassLoader.java:77)
    java.lang.ClassLoader.loadClass (ClassLoader.java:522)
    java.lang.Class.forName0 (Class.java:-2) 
    java.lang.Class.forName (Class.java:427) 
Based on the FntTransport text, I intuited that perhaps there was some versioning issue. I tried down-versioning to We are using nrepl 0.6.0, and nrepl/drawbridge 0.2.1, and lein 2.9.3, but had no luck. Any help on how I could debug this further greatly appreciated

dpsutton22:01:50

drawbridge depends on the old version of nrepl (seen from the clojure.tools.nrepl.transport namespace). From 0.3 and on nrepl moved to new coordinates nrepl rather than clojure.tools.

nezaj22:01:58

^ Curious, it seems like in drawbridge's project.clj they use nrepl 0.6.0 see: https://github.com/nrepl/drawbridge/blob/master/project.clj#L7

dpsutton22:01:57

i don't know. but something involved is looking for the old nrepl

dpsutton22:01:14

you could try lein deps :tree and see if anything involved uses the old nrepl

nezaj02:01:07

Closing the loop on this. Was able to get it working! Thanks to a combo of • Heroku docs - https://devcenter.heroku.com/articles/debugging-clojure • ~1yr blog post updated for newer version of drawbridge: https://blog.jakubholy.net/nrepl-over-http-with-drwabridge-in-2020/ • This GH issue which was updated ~ 3 weeks ago repro-ing the issue with the latest lein but having it work in 2.9.3: https://github.com/nrepl/drawbridge/issues/40

❤️ 3
Steffen Glückselig18:04:31

I just sumpled over drawbridge 0.2.1 not working with Leiningen 2.9.5 - what was the solution a year ago? Or has an alternative emerged?