2

我正在尝试运行我编写的一个小型 Clojure Web 应用程序,但我从 lein ring 服务器得到一个异常,它没有给我任何有用的信息。我用谷歌搜索了这个错误并发现了这个讨论,它建议运行lein deps :tree以解决问题,但这已经被贬值了。

完整的堆栈跟踪:

Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;
    at clojure.lang.Util.runtimeException(Util.java:165)
    at clojure.lang.Compiler.eval(Compiler.java:6476)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5275)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$require.doInvoke(core.clj:5352)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at monger.collection$eval698$loading__4505__auto____699.invoke(collection.clj:12)
    at monger.collection$eval698.invoke(collection.clj:12)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$require.doInvoke(core.clj:5352)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at donebox.views.landing$eval692$loading__4505__auto____693.invoke(landing.clj:1)
    at donebox.views.landing$eval692.invoke(landing.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5363)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at donebox.core$eval686$loading__4505__auto____687.invoke(core.clj:1)
    at donebox.core$eval686.invoke(core.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6455)
    at clojure.lang.Compiler.load(Compiler.java:6902)
    at clojure.lang.RT.loadResourceScript(RT.java:357)
    at clojure.lang.RT.loadResourceScript(RT.java:348)
    at clojure.lang.RT.load(RT.java:427)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$require.doInvoke(core.clj:5352)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at user$eval3.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    at clojure.lang.Compiler.eval(Compiler.java:6454)
    at clojure.lang.Compiler.eval(Compiler.java:6431)
    at clojure.core$eval.invoke(core.clj:2795)
    at clojure.main$eval_opt.invoke(main.clj:296)
    at clojure.main$initialize.invoke(main.clj:315)
    at clojure.main$null_opt.invoke(main.clj:348)
    at clojure.main$main.doInvoke(main.clj:426)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:405)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:518)
    at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;
    at monger.conversion$loading__4910__auto__.invoke(conversion.clj:24)
    at monger.conversion__init.load(Unknown Source)
    at monger.conversion__init.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:266)
    at clojure.lang.RT.loadClassForName(RT.java:2030)
    at clojure.lang.RT.load(RT.java:417)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4610.invoke(core.clj:5386)
    at clojure.core$load.doInvoke(core.clj:5385)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5200)
    at clojure.core$load_lib.doInvoke(core.clj:5237)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5271)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5363)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at monger.core$eval704$loading__4505__auto____705.invoke(core.clj:10)
    at monger.core$eval704.invoke(core.clj:10)
    at clojure.lang.Compiler.eval(Compiler.java:6465)
    ... 95 more
Subprocess failed

项目.clj:

(defproject donebox "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :source-paths ["src/main/clj"]
  :java-source-paths ["src/main/java"] ; Java source is stored separately.
  :test-paths ["test" "src/test/clojure"]
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [ring "1.2.0-RC1"]
                 [ring/ring-servlet "1.2.0-RC1"]
                 [compojure "1.1.5"]
                 [hiccup "1.0.3"]
                 [com.novemberain/monger "1.5.0"]
                 [org.clojure/data.xml "0.0.7"]
                 [org.clojure/data.json "0.2.2"]
                 [clj-oauth "1.4.0"]
                 [clojure-twitter "1.2.5"]
                 [ring-anti-forgery "0.2.1"]]
  :plugins [[lein-ring "0.8.5"]
            [lein-cljsbuild "0.3.2"]]
  :ring {:handler donebox.core/handler :init donebox.core/mongo-config :destroy donebox.core/disconnect}
  :cljsbuild {
    :builds [{
        ; The path to the top-level ClojureScript source directory:
        :source-paths ["src/main/cljs"]
        ; The standard ClojureScript compiler options:
        ; (See the ClojureScript compiler documentation for details.)
        :compiler {
          :output-to "resources/public/js/main.js"  ; default: target/cljsbuild-main.js
          :optimizations :advanced
          :pretty-print true}}]})

核心.clj:

(ns donebox.core
  (:use [compojure.core]
        [donebox.views.landing]
        [ring.middleware.params]
        [ring.middleware.anti-forgery])
  (:require [compojure.route :as route]
            [compojure.handler :as handler]
            [compojure.response :as response]
            [monger.core :as mg])) ;; Error here.

(defroutes main-routes
  (GET "/" [] (index))
  (POST "/process_index" [] (handle-index))
  (GET "/thankyou" [] (thankyou))
  (GET "/roadmap" [] (roadmap))
  (route/resources "/")
  (route/not-found "Page not found"))

(def handler
  (-> (handler/site main-routes)
      (wrap-params)
      (wrap-anti-forgery)))

(defn mongo-config []
  ((mg/connect-via-uri! "mongodb://<dbuser>:<dbpwd>@ds031628.mongolab.com:31628/donebox"))

(defn disconnect []
  (mg/disconnect!))

有没有关于我可以对此异常做些什么的信息?感谢您的时间和考虑。

4

1 回答 1

-4

这是一个简单的解决方法。

WARNING!!! possible confusing dependencies found:
[org.clojure/clojure "1.4.0"]
 overrides
[com.novemberain/monger "1.5.0"] -> [org.clojure/clojure "1.5.1"]
 and
[com.novemberain/monger "1.5.0"] -> [com.novemberain/validateur "1.4.0"] -> [org.clojure/clojure "1.5.1"]
 and
[com.novemberain/monger "1.5.0"] -> [clojurewerkz/support "0.15.0"] -> [org.clojure/clojure "1.5.1"]

[clojure-twitter "1.2.5"] -> [com.twinql.clojure/clj-apache-http "2.3.1"] -> [org.apache.httpcomponents/httpcore "4.0.1"]
 overrides
[clj-oauth "1.4.0"] -> [clj-http "0.5.3"] -> [org.apache.httpcomponents/httpclient "4.2.1"] -> [org.apache.httpcomponents/httpcore "4.2.1"]
 and
[clj-oauth "1.4.0"] -> [clj-http "0.5.3"] -> [org.apache.httpcomponents/httpmime "4.2.1"] -> [org.apache.httpcomponents/httpcore "4.2.1"]

 [clj-oauth "1.4.0"]
   [clj-http "0.5.3"]
     [cheshire "4.0.1"]
       [com.fasterxml.jackson.core/jackson-core "2.0.4"]
       [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.0.4"]
     [commons-codec "1.6"]
     [org.apache.httpcomponents/httpclient "4.2.1"]
     [org.apache.httpcomponents/httpmime "4.2.1"]
     [slingshot "0.10.3"]
 [clojure-complete "0.2.3"]
 [clojure-twitter "1.2.5"]
   [com.twinql.clojure/clj-apache-http "2.3.1"]
     [commons-logging "1.1.1"]
     [org.apache.httpcomponents/httpcore "4.0.1"]
   [org.clojure/clojure-contrib "1.2.0"]
 [com.novemberain/monger "1.5.0"]
   [clojurewerkz/support "0.15.0"]
     [com.google.guava/guava "14.0.1"]
   [com.novemberain/validateur "1.4.0"]
   [org.mongodb/mongo-java-driver "2.11.0"]
   [ragtime/ragtime.core "0.3.2"]
     [org.clojure/tools.cli "0.2.2"]
 [compojure "1.1.5"]
   [clout "1.0.1"]
   [org.clojure/core.incubator "0.1.0"]
   [org.clojure/tools.macro "0.1.0"]
 [hiccup "1.0.3"]
 [org.clojure/clojure "1.4.0"]
 [org.clojure/data.json "0.2.2"]
 [org.clojure/data.xml "0.0.7"]
 [org.clojure/tools.nrepl "0.2.3"]
 [ring-anti-forgery "0.2.1"]
   [crypto-random "1.1.0"]
 [ring/ring-servlet "1.2.0-RC1"]
   [javax.servlet/servlet-api "2.5"]
 [ring "1.2.0-RC1"]
   [ring/ring-core "1.2.0-RC1"]
     [clj-time "0.4.4"]
       [joda-time "2.1"]
     [commons-fileupload "1.3"]
     [commons-io "2.4"]
     [org.clojure/tools.reader "0.7.3"]
     [ring/ring-codec "1.0.0"]
   [ring/ring-devel "1.2.0-RC1"]
     [clj-stacktrace "0.2.5"]
     [ns-tracker "0.2.1"]
       [org.clojure/java.classpath "0.2.0"]
       [org.clojure/tools.namespace "0.1.3"]
   [ring/ring-jetty-adapter "1.2.0-RC1"]
     [org.eclipse.jetty/jetty-server "7.6.8.v20121106"]
       [org.eclipse.jetty.orbit/javax.servlet "2.5.0.v201103041518"]
       [org.eclipse.jetty/jetty-continuation "7.6.8.v20121106"]
       [org.eclipse.jetty/jetty-http "7.6.8.v20121106"]
         [org.eclipse.jetty/jetty-io "7.6.8.v20121106"]
           [org.eclipse.jetty/jetty-util "7.6.8.v20121106"]
于 2013-06-29T09:01:27.217 回答