lein ring uberwar NullPointerException
Working backwards from example ch17-webapp-lein in "Clojure Programming" by Emerick, Carper, and Grand, I've boiled my web service down to the bare minimum, hoping to deploy it to Elastic Beanstalk. I now have a repeatable NullPointerException
in lein ring uberwar.
I'd appreciate any help diagnosing or debugging this, or relaying it to the right people.
Here is my 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})
and here is the one and only src
file in the project
(ns com.clojurebook.hello-world
(:use
[compojure.core :only (GET HEAD defroutes)]))
(defroutes routes
(HEAD "/" [] "")
(GET "*" request "hello"))
When I do
lein ring uberwar
in the project directory, I get
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/56980.html