lein ring uberwar NullPointerException

在Emerick,Carper和Grand的“Clojure编程”中从example ch17-webapp-lein反向工作,我将我的web服务降到了最低限度,希望将其部署到Elastic Beanstalk。 我现在在lein ring uberwar.有一个可重复的NullPointerException lein 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)

升级到lein-ring 0.8.5修复了这个问题。

链接地址: http://www.djcxy.com/p/56979.html

上一篇: lein ring uberwar NullPointerException

下一篇: ring/compojure without jetty