我对 Carmine uberjar compile ( lein with-profile embed uberjar
) 有疑问。也许答案很简单,但我没有从其他论坛获得任何帮助。lein ring server-headless 8080 运行正常。如果我运行这个命令 lein with-profile embed uberjar,那么我会收到这个错误消息。你能帮我吗,正确的设置是什么?
提前致谢,RRR
(defproject fu "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[ring "1.3.2"]
[compojure "1.5.1"]
[ring/ring-defaults "0.2.1"]
[hiccup "1.0.5"]
[selmer "1.10.3"]
[com.cemerick/friend "0.2.0"]
[de.ubercode.clostache/clostache "1.4.0"]
[com.taoensso/carmine "2.15.0"]]
:main fu.handler
:plugins [[lein-ring "0.9.7"]]
:ring {:handler fu.handler/app
:auto-reload? true
:auto-refresh? true}
:aot [fu.handler]
:uberjar-name "fu-example-default.jar"
:profiles {
:provided {:dependencies [[nginx-clojure "0.4.4"]]}
:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-mock "0.3.0"]]}
:embed {:dependencies
[[nginx-clojure/nginx-clojure-embed "0.4.4"]]
:aot [fu.handler]
:main fu.handler
:uberjar-name "fu-example-embed.jar"
}
})
错误信息:
lein with-profile embed uberjar WARNING: You are running as root; 可能是偶然的。按 control-C 中止或 Enter 以 root 身份继续。设置 LEIN_ROOT 以禁用此警告。</p>
Compiling fu.handler
Compiling fu.handler
nil
Exception in thread "main" java.lang.ExceptionInInitializerError, compiling:(/tmp/form-init8960082151990763547.clj:1:73)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$compile$fn__5682.invoke(core.clj:5903)
at clojure.core$compile.invokeStatic(core.clj:5903)
at clojure.core$compile.invoke(core.clj:5895)
at user$eval20$fn__29.invoke(form-init8960082151990763547.clj:1)
at user$eval20.invokeStatic(form-init8960082151990763547.clj:1)
at user$eval20.invoke(form-init8960082151990763547.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
... 14 more
Caused by: java.lang.ClassCastException: taoensso.carmine.protocol.Context cannot be cast to taoensso.carmine.protocol.Context
at taoensso.carmine.commands$enqueue_request.invokeStatic(commands.clj:211)
at taoensso.carmine.commands$enqueue_request.invoke(commands.clj:196)
at taoensso.carmine$keys.invokeStatic(carmine.clj:128)
at taoensso.carmine$keys.invoke(carmine.clj:128)
at fu.handler$fn__8942$fn__8943$fn__8944.invoke(handler.clj:35)
at taoensso.carmine.protocol$_with_replies.invokeStatic(protocol.clj:340)
at taoensso.carmine.protocol$_with_replies.invoke(protocol.clj:328)
at fu.handler$fn__8942$fn__8943.invoke(handler.clj:35)
at fu.handler$fn__8942.invokeStatic(handler.clj:35)
at fu.handler$fn__8942.invoke(handler.clj:35)
at fu.handler__init.load(Unknown Source)
at fu.handler__init.<clinit>(Unknown Source)
... 36 more
编译失败:子进程失败 Uberjar 中止,因为 jar 失败:编译失败:子进程失败 执行任务 'uberjar' 时遇到错误,配置文件:'embed' Uberjar 中止,因为 jar 失败:编译失败:子进程失败