Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Clojure 带有lein droid的ClassNotFoundException和ClassCastException_Clojure_Classnotfoundexception_Classcastexception - Fatal编程技术网

Clojure 带有lein droid的ClassNotFoundException和ClassCastException

Clojure 带有lein droid的ClassNotFoundException和ClassCastException,clojure,classnotfoundexception,classcastexception,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:

当在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教程中设置):

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

柴郡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"]
不依赖柴郡

» 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"]

您的依赖项不匹配是因为某些依赖项引入了旧版本的库,
lein-deps:tree
的输出和完整的stacktrace是什么?我将
lein-deps:tree
的输出添加到了问题中,它似乎非常相关。如果需要的话,我会稍后发布堆栈跟踪,因为它们会使文章变得太混乱。
» 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"]