运行lein new luminus <app-name> +jetty +mongodb +re-frame +cider
命令时,我uberjar
生成了一个小应用程序错误。它可以作为通过lein repl
运行的开发应用程序。
由于使用了Datomic,我发现类似的错误被归结为依赖性不匹配,但是我的项目当前不是依赖项。
这是通过调用lein uberjar
生成的堆栈跟踪:
See https://github.com/technomancy/leiningen/wiki/Repeatability)
Retrieving org/clojure/core.async/0.2.374/core.async-0.2.374.jar from central
Retrieving org/clojure/tools.analyzer.jvm/0.6.9/tools.analyzer.jvm-0.6.9.jar from central
Retrieving org/clojure/tools.analyzer/0.6.7/tools.analyzer-0.6.7.jar from central
Compiling myapp.env
Compiling myapp.elastic.common
Compiling myapp.elastic.indexer
Compiling myapp.web.config
Compiling myapp.web.core
Compiling myapp.web.db.core
Compiling myapp.web.handler
Compiling myapp.web.layout
Compiling myapp.web.middleware
Compiling myapp.web.routes.home
Compiling myapp.validation
Compiling ClojureScript...
Retrieving cljsbuild/cljsbuild/1.1.4/cljsbuild-1.1.4.pom from clojars
Retrieving org/clojure/clojurescript/0.0-3211/clojurescript-0.0-3211.pom from central
Retrieving org/clojure/clojure/1.7.0-beta1/clojure-1.7.0-beta1.pom from central
Retrieving cljsbuild/cljsbuild/1.1.4/cljsbuild-1.1.4.jar from clojars
Compiling "target/cljsbuild/public/js/app.js" from ["src/cljc" "src/cljs" "env/prod/cljs"]...
Compiling "target/cljsbuild/public/js/app.js" failed.
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;, compiling:(/private/var/folders/ms/7lyl677n0zz5dnw0wxffj8j00000gn/T/form-init4762266950288731870.clj:1:125)
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.NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher;
at com.google.javascript.jscomp.parsing.JsDocInfoParser.validTemplateTypeName(JsDocInfoParser.java:1233)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseAnnotation(JsDocInfoParser.java:953)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parseHelperLoop(JsDocInfoParser.java:290)
at com.google.javascript.jscomp.parsing.JsDocInfoParser.parse(JsDocInfoParser.java:280)
at com.google.javascript.jscomp.parsing.IRFactory.createJsDocInfoParser(IRFactory.java:910)
at com.google.javascript.jscomp.parsing.IRFactory.handleJsDoc(IRFactory.java:692)
at com.google.javascript.jscomp.parsing.IRFactory.handleJsDoc(IRFactory.java:706)
at com.google.javascript.jscomp.parsing.IRFactory.transform(IRFactory.java:766)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.processAstRoot(IRFactory.java:1024)
at com.google.javascript.jscomp.parsing.IRFactory$TransformDispatcher.process(IRFactory.java:2712)
at com.google.javascript.jscomp.parsing.IRFactory.transformTree(IRFactory.java:356)
at com.google.javascript.jscomp.parsing.ParserRunner.parse(ParserRunner.java:129)
at com.google.javascript.jscomp.JsAst.parse(JsAst.java:142)
at com.google.javascript.jscomp.JsAst.getAstRoot(JsAst.java:52)
at com.google.javascript.jscomp.CompilerInput.getAstRoot(CompilerInput.java:118)
at com.google.javascript.jscomp.Compiler.parseInputs(Compiler.java:1443)
at com.google.javascript.jscomp.Compiler.parse(Compiler.java:775)
at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:731)
at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:83)
at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:698)
at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:695)
at com.google.javascript.jscomp.CompilerExecutor$2.call(CompilerExecutor.java:93)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Uberjar aborting because jar failed: Subprocess failed
答案 0 :(得分:3)
我通过将[com.google.guava/guava "21.0"]
添加到:dependencies
project.clj
来解决类似问题
答案 1 :(得分:1)
好的,所以线索是依赖性不匹配。虽然lein deps :tree
没有显示任何错误,但问题在于monger
取决于com.google.guava/guava
。
将:exclusions [com.google.guava/guava]
添加到guava
中依赖monger
(包括project.clj
)并将org.clojure/clojurescript
移至依赖关系列表顶部的每个库中我能够让构建工作正常,因为我认为使用了Clojurescript版本的guava
的正确版本。