title: ClassNotFoundException and ClassCastException with lein-droid
body: <p>When building a lein-droid project with <code>[clj-http "0.7.7"]</code> as  a dependency in project.clj, it fails with the following error [0]:</p>
  
  <pre><code>Compiling cheshire.jsonp
  Exception in thread "main" java.lang.ClassNotFoundException: javax.json.Json, compiling:(jsonp.clj:1:1)
  [...]
  Caused by: java.lang.ClassNotFoundException: javax.json.Json
  [...]
  </code></pre>
  
  <p>Replacing the dependency with <code>[cheshire "5.2.0"]</code> (current version) produces the same error. Lowering the version to "5.1.1" removes this error. </p>
  
  <p>Adding <code>[clj-http "0.7.7"]</code> as a dependency to the project introduces a new error [1]:</p>
  
  <pre><code>Compiling clj-http.conn-mgr
  Exception in thread "main" java.lang.ClassCastException clj_http.conn_mgr$fn$reify__20 cannot be cast to java.security.KeyStore, compiling:(conn_mgr.clj:13:3)
  [...]
  Caused by: java.lang.ClassCastException: clj_http.conn_mgr$fn$reify__20 cannot be cast to java.security.KeyStore
  [...]
  </code></pre>
  
  <p>Relevant settings from project.clj (set from the lein-droid tutorial):</p>
  
  <pre><code>:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
  :android { ...
      :target-version "16"
  ...}
  </code></pre>
  
  <p>Changing these settings to the current version numbers doesn't change the error. </p>
  
  <p><strong>With cheshire 5.2.0</strong></p>
  
  <pre><code>» lein deps :tree          
  WARNING!!! possible confusing dependencies found:
  [clojure-complete "0.2.3"]
   overrides
  [clojure-complete "0.2.3"]
  
  [cheshire "5.1.1"]
   overrides
  [clj-http "0.7.7"] -&gt; [cheshire "5.2.0"]
  </code></pre>
  
  <p><strong>Without cheshire in dependencies</strong></p>
  
  <pre><code>» lein deps :tree     
  WARNING!!! possible confusing dependencies found:
  [org.clojure/data.json "0.2.3"] -&gt; [org.clojure/clojure "1.4.0"]
   overrides
  [clj-http "0.7.7"] -&gt; [cheshire "5.2.0"] -&gt; [tigris "0.1.1"] -&gt; [org.clojure/clojure "1.5.1"]
  
  [clojure-complete "0.2.3"]
   overrides
  [clojure-complete "0.2.3"]
  </code></pre>