taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

lein uberjar fails or lein repl fails depending on encore #181

Closed funston closed 7 years ago

funston commented 7 years ago

I can get either lein uberjar to work or lein repl, but not both.

1) lein repl will work with the following, but lein uberjar will fail with "Caused by: java.lang.RuntimeException: No such var: taoensso.encore/encore-version"

             [com.taoensso/encore "1.20.0"]
             [com.taoensso/carmine "2.14.0"]

2) lein uberjar will work and lein repl will fail if I remove the specific encore dependency. (with [taoensso.encore$loading5569auto__1128 invoke encore.clj 1], :cause Could not locate clojure/tools/reader/impl/ExceptionInfoinit.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath.)

I've been having to just path project.clj before builds and messing with various combinations, (like ;[com.taoensso/carmine "2.12.2" :exclusions [com.taoensso/encore]]) to no avail

clojure 1.8.0 Leiningen 2.5.2 on Java 1.8.0_40 Java HotSpot(TM) 64-Bit Server VM

ptaoussanis commented 7 years ago

[com.taoensso/encore "1.20.0"]

Hi there, that's an ancient version of encore. The current version is 2.68.1. Please see here if you're having a dependency conflict.

funston commented 7 years ago

Pasted something mid trying out various things. Still doesn't work. I review the dependency conflict and have this, to explicitly set the order, but lein repl still fails. lein uberjar is okay

[com.taoensso/encore "2.68.1"]
[com.taoensso/carmine "2.14.0"]

The only way I can get lein repl to work is to force carmine to exclude encore.

ptaoussanis commented 7 years ago

So with [com.taoensso/encore "2.68.1"] as a dependency, you're still getting a No such var: taoensso.encore/encore-version" error?

That doesn't sound right. The var is available with encore 2.68.1.

You may need to run lein clean or double check that your build process isn't pulling in an older version for some ready. (You may want to try lein-pprint).

funston commented 7 years ago

lein repl is a different error. did a lein clean first.

repl fails starting at

[taoensso.encore$loading5569auto____1128 invoke encore.clj 1]

and ending with this (but if I exclude encore from carmine it works AND use encore [com.taoensso/encore "1.20.0" it works. I can't get lein repl to work at all with 2.68.1 encore)

error {

:cause Could not locate clojure/tools/reader/impl/ExceptionInfoinit.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath. :via [{:type clojure.lang.Compiler$CompilerException :message java.lang.ExceptionInInitializerError, compiling:(kraken/core.clj:1:1) :at [clojure.lang.Compiler load Compiler.java 7391]} {:type java.lang.ExceptionInInitializerError :message nil :at [java.lang.Class forName0 Class.java -2]} {:type java.io.FileNotFoundException :message Could not locate clojure/tools/reader/impl/ExceptionInfoinit.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath. :at [clojure.lang.RT load RT.java 456]}] :trace

funston commented 7 years ago

fwiw, this is the only way/combo I can use to get lein repl to work, but it causes lein uberjar to fail

             [com.taoensso/carmine "2.12.2" :exclusions [com.taoensso/encore]]
ptaoussanis commented 7 years ago

fwiw, this is the only way/combo I can use to get lein repl to work, but it causes lein uberjar to fail

That will cause lein uberjar to fail because you're explicitly excluding a required dependency.

Unfortunately finding this thread a bit difficult to follow and I need to run. Will recap:

  1. Use lein deps :tree to check what your deps are looking like. Make sure that you've got the latest encore version there. See here if you've got a dependency conflict.
  2. Could not locate clojure/tools/reader/impl/ExceptionInfo__init.class or clojure/tools/reader/impl/ExceptionInfo.clj on classpath could be caused by a tools.reader dependency conflict, a version of tools.reader that's too old, or a version of Clojure that's too old. You might want to check what dependencies lein repl is loading.
  3. Make sure to try lein clean between attempts to rule-out artifact issues.
  4. Try lein pprint to rule out project.clj config issues.
  5. If all else fails, try start a fresh project and introduce your deps 1-by-1 to isolate the problem.

Best of luck, cheers :-)

funston commented 7 years ago

k, thanks for your help. i'll clean up my comment to clear this up soon, but tried a bunch of things, including downgrading lein to 2.5.1

the only thing that works for me with both uberjar/repl is:

[com.taoensso/carmine "2.11.1"]

ptaoussanis commented 7 years ago

Assuming this is resolved, will otherwise request a reproducible example for further debugging. Cheers!