I am trying to make a sample web application on clojure that uses reitit and exposes its structure via swagger. To that end i have added code that handles request for "/swagger.json" as outlined in examples. Here is overall code: full file
Relevant sections are these:
(defn make-default-routes [] (ring/routes (ring/redirect-trailing-slash-handler) (ring/create-resource-handler {:path "/"}) (swagger-ui/create-swagger-ui-handler {:path "/swag"}) (ring/create-default-handler {:not-found (constantly {:status 404, :body (missing-page), :headers {}})}))) (defn make-app [system] (ring/ring-handler (ring/router [["/" {:get {:handler (constantly (resp/redirect "/landing"))} :swagger {:info {:title "wh-invasion"} :basePath "/"}}] ["/swagger.json" {:get {:no-doc true :handler (swagger/create-swagger-handler)}}] ["/landing" {:swagger {:tags ["user"]} :get {:handler (fn app [req] {:status 200 :headers {"Content-Type" "text/html"} :body (landing-page)})}}] ["/api" {:middleware [[wrap-json-body {:malformed-response {:status 400 :headers {"Content-Type" "text/plain"} :body "Malformed json in request"}}] wrap-json-response wrap-stacktrace [wrap-system system]] :swagger {:tags ["api"]}} ["/cards" ["/meta/:meta-param" {:get #(get-meta-parameter %) :put #(put-meta-parameter %)}]]] ["/admin" {:middleware [[wrap-system system]] :swagger {:tags ["admin"]}} ["/card" (fn [_req_] {:status 200 :headers {"Content-Type" "text/html"} :body (add-card-page)})]]]) (make-default-routes))) However when i try to access that route, i get the following exception (with stacktrace):
Unhandled java.lang.NoClassDefFoundError
Caused by java.lang.ClassNotFoundException reitit.ring.Endpoint$reify__4406
ring.cljc: 16 reitit.ring.Endpoint/getLookupThunkKeywordLookupSite.java: 52 clojure.lang.KeywordLookupSite/install
KeywordLookupSite.java: 26 clojure.lang.KeywordLookupSite/fault
REPL: 103 reitit.swagger/create-swagger-handler/create-swagger ring.cljc: 357 reitit.ring$ring_handler$fn__4583/invoke AFunction.java: 31 clojure.lang.AFunction$1/doInvoke REPL: 474 conquest.webapp/eval12393
Exception copied from cider buffer.
My versions of libraries used are "0.7.0" for all reitit libs.
What could be the reason for this behaviour? How can i fix it?
reitit.ring.Endpoint$reify__4406or is that just the location where it happened.cljorlein, without any extra tools in between.