https://github.com/cgrand/enliveから非常に基本的なサンプルをコピーしましたが、コンパイルされません:
(ns web.handler
(:require
[compojure.core :refer :all]
[compojure.handler]
[compojure.route :as route]
[net.cgrand.enlive-html :as html]))
;; Compiler throws in the next line, see the message below.
(html/deftemplate main-template "templates/index.html"
[]
[:head :title] (html/content "Enlive starter kit"))
(defroutes app-routes
(GET "/" [] "Hello")
(GET "/ping/:what" [what] (str "<h1>Ping '" what "'</h1>"))
(route/resources "/")
(route/not-found "Not Found"))
(def app
(compojure.handler/site app-routes))
私が得るエラー:
java.lang.NullPointerException, compiling:(handler.clj:9:1)
私はコマンドで実行します:
lein ring server-headless
それを機能させる方法は?
編集
これまでの私の調査: からのエラースローenlive-html.clj:54
:
(defn tagsoup-parser
"Loads and parse an HTML resource and closes the stream."
[stream]
(filter map?
(with-open [^java.io.Closeable stream stream]
(xml/parse (org.xml.sax.InputSource. stream) startparse-tagsoup)))) ; #54
おそらくorg.xml.sax
参照されていませんか?どうすればこれを行うことができlein
ますか?