1

从 Emerick、Carper 和 Grand的“Clojure 编程”中的示例 ch17-webapp-lein向后工作,我将我的 Web 服务精简到最低限度,希望将其部署到 Elastic Beanstalk。我现在有一个可重复的, 我会很感激任何帮助诊断或调试这个,或者将它转发给合适的人。NullPointerExceptionlein ring uberwar.

这是我的project.clj

(defproject com.clojurebook/sample-lein-web-project "1.0.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [compojure/compojure "1.0.0"]
                 [ring "1.1.8"]]
  :plugins [[lein-ring "0.6.2"]
            [lein-beanstalk "0.2.7"]]
  :ring {:handler com.clojurebook.hello-world/routes})

这是项目中唯一src的文件

(ns com.clojurebook.hello-world
  (:use
    [compojure.core :only (GET HEAD defroutes)]))

(defroutes routes
  (HEAD "/" [] "")
  (GET "*" request "hello"))

当我做

lein ring uberwar 

在项目目录中,我得到

java.lang.NullPointerException
    at clojure.lang.Numbers.ops(Numbers.java:942)
    at clojure.lang.Numbers.isZero(Numbers.java:90)
    at leiningen.ring.uberwar$uberwar.invoke(uberwar.clj:45)
    at leiningen.ring.uberwar$uberwar.invoke(uberwar.clj:43)
    at clojure.lang.AFn.applyToHelper(AFn.java:161)
    at clojure.lang.AFn.applyTo(AFn.java:151)
    at clojure.core$apply.invoke(core.clj:619)
    at leiningen.ring$ring.doInvoke(ring.clj:19)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.core$apply.invoke(core.clj:619)
    at leiningen.core.main$resolve_task$fn__1836.doInvoke(main.clj:149)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:619)
    at leiningen.core.main$apply_task.invoke(main.clj:189)
    at leiningen.core.main$resolve_and_apply.invoke(main.clj:193)
    at leiningen.core.main$_main$fn__1899.invoke(main.clj:257)
    at leiningen.core.main$_main.doInvoke(main.clj:247)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.core$apply.invoke(core.clj:617)
    at clojure.main$main_opt.invoke(main.clj:335)
    at clojure.main$main.doInvoke(main.clj:440)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at clojure.lang.Var.invoke(Var.java:427)
    at clojure.lang.AFn.applyToHelper(AFn.java:172)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.main.main(main.java:37)
4

1 回答 1

0

升级到lein-ring 0.8.5解决了这个问题。

于 2013-05-22T19:22:02.843 回答