1

I'm having a lot of trouble fixing an issue where the dependencies for two different packages are colliding. My project.clj's dependencies look like this:

  :dependencies [[org.clojure/clojure "1.6.0"]
                 [itsy "0.1.1"]  
                 [amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient com.fasterxml.jackson.core/jackson-core]]])

My namespace looks like this:

(ns crawler.core
  (:require [itsy.core :refer :all])
  (:require [itsy.extract :refer :all])
  (:use  [amazonica.core]
         [amazonica.aws.s3]))

When I try to load the namespace into lein's repl with (load crawler/core), I get this error:

CompilerException java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonFactory.requiresPropertyOrdering()Z, compiling:(amazonica/core.clj:1:1)

Online sources suggest that this is a dependency mismatch. How do I fix it?

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
user592419
  • 5,103
  • 9
  • 42
  • 67
  • could you include the part of the output from running "lein deps :tree" that mentions either itsy or amazonica. there will most likely be a suggested exclusion in the output as well – Arthur Ulfeldt May 22 '15 at 20:57

1 Answers1

1

I put the exclusion on itsy rather than amazonica and it worked. Also fixed the NS form in core.clj.

project.clj:

(defproject blabla "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
  :url "http://example.com/FIXME"
   :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.6.0"]
                 [itsy "0.1.1" :exclusions [com.fasterxml.jackson.core/jackson-core]]  
                  [amazonica "0.3.22" :exclusions [commons-logging org.apache.httpcomponents/httpclient]]])

core.clj:

(ns blabla.core
  (:require [itsy.core :refer :all]
            [itsy.extract :refer :all]
            [amazonica.core :refer :all]
            [amazonica.aws.s3 :refer :all]))

(defn foo
   "I don't do a whole lot."
  [x]
   (println x "Hello, World!"))

to deal with these situatuions in general run

lein deps :tree

and add exclusions until only the newest versions remain.

Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
  • Thanks Arthur. I'll try this later tonight. I actually did do what you suggest regarding running lein deps :tree and adding in exclusions until it stopped making suggestions. That's how I got to the above. – user592419 May 23 '15 at 00:19