我的目标是使用的Compojure来创建Web应用程序和附加datomic数据库。单独来看,这两个部件做工精细。然而,当我尝试启动lein ring server-headless
服务器(包括datomic作为依赖)与enourmous错误。错误输出的头:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/util/component/AggregateLifeCycle, compiling:(ring/adapter/jetty.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
使用project.clj
(defproject pinvest "0.1.0-SNAPSHOT"
:description "foobar"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/core.async "0.3.442"]
[org.clojure/tools.namespace "0.2.11"]
[compojure "1.5.1"]
[ring/ring-defaults "0.2.1"]
[com.datomic/clj-client "0.8.606"]]
:plugins [[lein-ring "0.9.7"]]
:ring {:handler pinvest.handler/app}
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-mock "0.3.0"]]}})
最初lein new compojure foo
产生。依赖性com.datomic/clj-client
在启动服务器造成问题的原因。
我试图排除一些依赖,通过使我project.clj
与
[com.datomic/clj-client "0.8.606"
:exclusions [org.eclipse.jetty/jetty-http
org.eclipse.jetty/jetty-util
org.eclipse.jetty/jetty-client]]
但只是导致
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: org.eclipse.jetty.client.HttpClient, compiling:(cognitect/http_client.clj:1:1)
任何帮助将不胜感激。
PS。我是一个新手,Clojure的,并且这些错误消息都只是无法理解
尽量不要使用码头。从谁与现在非常相似的问题就来收拾残局组有人使用这个组合(到位码头的HTTP-KIT):
[com.datomic/datomic-free "0.9.5544"] [ring/ring-core "1.5.0"] [http-kit "2.2.0"]
我就遇到了这个问题也是一样,能找到没有解决方法。从我的理解,它看起来像环核心是利用传统用途的旧码头适配器。我发现https://github.com/sunng87/ring-jetty9-adapter一个值得作为替代到目前为止,在我的设置没有进一步的问题环扶养:
[com.datomic/clj-client "0.8.606" :exclusions [org.eclipse.jetty/jetty-http org.eclipse.jetty/jetty-util org.eclipse.jetty/jetty-client]]
[info.sunng/ring-jetty9-adapter "0.10.0"]
这很古怪。该:exclusion
工作对我来说(但我认为它不为你工作)。它的记录here
[com.datomic/client-pro "0.8.28"
:exclusions [org.eclipse.jetty/jetty-client
org.eclipse.jetty/jetty-http
org.eclipse.jetty/jetty-util]]