由Emerick,Carper和Grand从example ch17-webapp-lein的"Clojure Programming"向后工作,我将我的网络服务降到最低限度,希望将其部署到Elastic Beanstalk。我现在在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)