首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Compojure with Datomic不会编译

Compojure with Datomic不会编译
EN

Stack Overflow用户
提问于 2019-09-12 14:27:47
回答 1查看 122关注 0票数 1

我正在设置一个压缩应用程序,我想将数据作为我的数据库--但是一旦我添加了client-pro依赖项,我的应用程序就不能运行了。

我所做的是:

  1. 为帐户注册
  2. 下载datomic-pro
  3. 创建了一个transactor.properties并使用我在电子邮件中收到的license-key更新了它
  4. Ran bin/transactor transactor.properties
  5. 打开另一个选项卡,并创建一个数据库:
代码语言:javascript
复制
(require ‘[datomic.api :as d])
(def db-uri “datomic:dev://localhost:4334/hello”)
(d/create-database db-uri)
  1. 在另一个选项卡上启动对等服务器。
代码语言:javascript
复制
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d hello,datomic:dev://localhost:4334/hello
  1. [com.datomic/client-pro “0.8.28”]添加到我的依赖项中

在运行lein ring server时,我会得到以下错误:

代码语言:javascript
复制
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.thread.NonBlockingThread
EN

回答 1

Stack Overflow用户

发布于 2019-09-12 17:08:57

一个快速的一旁

这不是一个直接的答案,但是如果您只是在寻找一个快速开始的数据体,您可以在这里克隆Tupelo Datomic:

https://github.com/cloojure/tupelo-datomic

它包括一个预先配置版本的数据自由.只要运行lein test就可以看到它在运行。然后,您可以添加自己的代码。

关于Jetty

艾文的答案可能是你所需要的。另一种可能是,您可能需要在特定版本中添加传递依赖项,并在其他版本上使用:exclude。还请注意,在project.clj中,重要的deps 必须在文件的顶部列出,因为这些deps版本(及其传递的deps版本)将覆盖以后指定的任何deps版本。

我有一个在project.clj中看起来像这样的项目的lein

代码语言:javascript
复制
  :exclusions [cheshire
               com.cognitect/transit-clj
               com.cognitect/transit-cljs
               com.cognitect/transit-java
               com.cognitect/transit-js
               com.fasterxml.jackson.core/jackson-core
               com.fasterxml.jackson.core/jackson-databind
               com.fasterxml.jackson.dataformat/jackson-dataformat-cbor
               com.fasterxml.jackson.dataformat/jackson-dataformat-smile
               joda-time/joda-time
               org.eclipse.jetty/jetty-server]

  :dependencies [
                 ; fundamental items must come first to override later transitive dependencies
                 [cheshire "5.8.1"]
                 [com.cognitect/transit-clj "0.8.313"]
                 [com.cognitect/transit-cljs "0.8.256"]
                 [com.cognitect/transit-java "0.8.337"]
                 [com.cognitect/transit-js "0.8.861"]
                 [com.fasterxml.jackson.core/jackson-core "2.9.9"]
                 [com.fasterxml.jackson.core/jackson-databind "2.9.9"]
                 [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.9.9"]
                 [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.9.9"]
                 [joda-time/joda-time "2.10.3"]
                 [org.clojure/clojure "1.10.1"]
                 [org.eclipse.jetty/jetty-server "9.4.19.v20190610"]

然后列出了第二层人员的名单:

代码语言:javascript
复制
                 ; high-priority libs, ensure these versions override any transitive dependency versions
                 [binaryage/devtools "0.9.10"]
                 [binaryage/oops "0.7.0"]
                 [com.andrewmcveigh/cljs-time "0.5.2"]
                 [com.cemerick/url "0.1.1"]
                 [org.clojure/core.async "0.4.500" :exclusions [org.clojure/tools.reader]]
                 [org.clojure/core.match "0.3.0"]
                 [org.clojure/test.check "0.9.0"]
                 [org.clojure/tools.cli "0.4.2"]
                 [org.clojure/tools.logging "0.5.0"]
                 [org.clojure/tools.nrepl "0.2.13"] ; #todo #awt upgrade => [nrepl "0.3.1"] from https://github.com/nrepl/nrepl
                 [prismatic/schema "1.1.11"]
                 [tupelo "0.9.144"]
                 [venantius/accountant "0.2.4"]

然后是第三层人员:

代码语言:javascript
复制
                 ; "normal" dependency libs, whose transitive dependencies can be overridden by previous libs
                 [ch.qos.logback/logback-classic "1.2.3"]
                 [clj-http "3.10.0"]
                 [clj-time "0.15.1"] ; #todo switch to java.time & tupelo.java-time
                 [cljsjs/cytoscape "3.1.4-0"]
                 [com.amazonaws/aws-java-sdk "1.11.602" :exclusions [joda-time]]
                 [com.taoensso/carmine "2.19.1"]
                 [compojure "1.6.1"]
                 [cprop "0.1.14"]
                 [expound "0.7.2"]
                 [funcool/struct "1.4.0"]
                 [io.janusplatform/janus-environment-config "1.8.7-SNAPSHOT"]
                 [io.janusplatform/janus-logging-java "1.0.11-SNAPSHOT" :exclusions [com.google.guava/guava]]
                 [io.janusplatform/janus-resource-connector "4.3.0-SNAPSHOT"]
                 [jayq "2.5.5"]
                 [luminus-jetty "0.1.7" ]
                 [luminus-nrepl "0.1.6"]
                 [luminus/ring-ttl-session "0.3.3"]
                 [markdown-clj "1.10.0"]
                 [metosin/muuntaja "0.2.1"]
                 [metosin/ring-http-response "0.9.1"]
                 [metosin/spec-tools "0.10.0"]
                 [metosin/scjsv "0.5.0"]
                 [metrics-clojure-ring "2.10.0"]
                 [mount "0.1.16"]
                 [org.webjars/bootstrap "4.3.1"]
                 [org.webjars/font-awesome "5.9.0"]
                 [overtone/at-at "1.2.0"]
                 [ring-webjars "0.2.0"]
                 [ring/ring-codec "1.1.2"]
                 [ring/ring-core "1.7.1"]
                 [ring/ring-defaults "0.3.2"]
                 [ring/ring-json "0.4.0"]
                 [throttler "1.0.0"]

还有一些军演人员:

代码语言:javascript
复制
                 [amazonica "0.3.145" :exclusions [com.amazonaws/aws-java-sdk
                                                   com.fasterxml.jackson.core/jackson-core
                                                   com.fasterxml.jackson.dataformat/jackson-dataformat-cbor
                                                   org.apache.httpcomponents/httpclient]]    ; #todo do we really need all these exclusions???

                 [cljs-ajax "0.8.0" :exclusions [cheshire
                                                 com.cognitect/transit-clj
                                                 com.cognitect/transit-java
                                                 org.apache.httpcomponents/httpasyncclient
                                                 org.apache.httpcomponents/httpcore
                                                 org.msgpack/msgpack]]    ; #todo do we really need all these exclusions???

                 [org.springframework/spring-webmvc "5.1.8.RELEASE" :exclusions [org.springframework/spring-jcl
                                                                                 org.springframework/spring-aop]]
                 ]

您还可以看到,我必须排除Jetty,以防止传递依赖引入错误的版本,然后具体添加我想要的版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57908915

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档