带有lein-droid的ClassNotFoundException和ClassCastException

时间:2013-11-25 20:51:46

标签: clojure classnotfoundexception classcastexception

在project.clj中使用[clj-http "0.7.7"]构建lein-droid项目作为依赖项时,它失败并出现以下错误[0]:

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
[...]

[cheshire "5.2.0"](当前版本)替换依赖项会产生相同的错误。将版本降低到“5.1.1”会删除此错误。

[clj-http "0.7.7"]作为依赖项添加到项目中会引入新错误[1]:

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
[...]

来自project.clj的相关设置(从lein-droid教程设置):

:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
:android { ...
    :target-version "16"
...}

将这些设置更改为当前版本号不会更改错误。

使用cheshire 5.2.0

» 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"] -> [cheshire "5.2.0"]

依赖关系中没有cheshire

» lein deps :tree     
WARNING!!! possible confusing dependencies found:
[org.clojure/data.json "0.2.3"] -> [org.clojure/clojure "1.4.0"]
 overrides
[clj-http "0.7.7"] -> [cheshire "5.2.0"] -> [tigris "0.1.1"] -> [org.clojure/clojure "1.5.1"]

[clojure-complete "0.2.3"]
 overrides
[clojure-complete "0.2.3"]

0 个答案:

没有答案