Question

I'm using leiningen to develop 2 projects simultaneously (see Checkout Dependencies here). That's working and I've gotten it to a point where I want to deploy both libraries. Let's say they are lib-parent , which uses lib-child.

Now, I've deployed lib-child to clojars (lein deploy clojars). But if I now include lib-child as a project dependency in lib-parent, I can't load lib-child because one of it's dependencies (Datomic and it's use of com.google.common.cache.Cache) doesn't load. Running (require 'lib-child.plugin) at the repl will give me a ClassNotFoundException : com.google.common.cache.Cache.

Is this i) a general leiningen dependency issue or ii) an issue with Datomic not getting all of it's dependencies? I'm using [com.datomic/datomic-free "0.8.4143" :exclusions [org.slf4j/slf4j-nop org.slf4j/log4j-over-slf4j]].

user=> (require 'lib-child.plugin)
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.

ClassNotFoundException com.google.common.cache.Cache  java.net.URLClassLoader$1.run (URLClassLoader.java:366)
user=> (pst *e)
ExceptionInInitializerError 
        java.lang.Class.forName0 (Class.java:-2)
        java.lang.Class.forName (Class.java:270)
        clojure.lang.RT.loadClassForName (RT.java:2098)
        clojure.lang.RT.load (RT.java:430)
        clojure.lang.RT.load (RT.java:411)
        clojure.core/load/fn--5018 (core.clj:5530)
        clojure.core/load (core.clj:5529)
        clojure.core/load-one (core.clj:5336)
        clojure.core/load-lib/fn--4967 (core.clj:5375)
        clojure.core/load-lib (core.clj:5374)
        clojure.core/apply (core.clj:619)
        clojure.core/load-libs (core.clj:5413)
Caused by:
ClassNotFoundException com.google.common.cache.Cache
        java.net.URLClassLoader$1.run (URLClassLoader.java:366)
        java.net.URLClassLoader$1.run (URLClassLoader.java:355)
        java.security.AccessController.doPrivileged (AccessController.java:-2)
        java.net.URLClassLoader.findClass (URLClassLoader.java:354)
        java.lang.ClassLoader.loadClass (ClassLoader.java:424)
        sun.misc.Launcher$AppClassLoader.loadClass (Launcher.java:308)
        java.lang.ClassLoader.loadClass (ClassLoader.java:357)
        java.lang.Class.forName0 (Class.java:-2)
        java.lang.Class.forName (Class.java:190)
        datomic.cache__init.__init0 (:-1)
        datomic.cache__init.<clinit> (:-1)
        java.lang.Class.forName0 (Class.java:-2)

Thanks

Was it helpful?

Solution

Ok, fixed this. Removed all the :exclusions, in the Datomic declaration I used, in the lib-child project. Thanks to @hyPiRion on #leiningen @irc.freenode.org.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top