This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-21
Channels
- # beginners (165)
- # boot (9)
- # cider (9)
- # cljs-dev (5)
- # cljsjs (5)
- # clojars (4)
- # clojure (207)
- # clojure-brasil (1)
- # clojure-greece (3)
- # clojure-poland (2)
- # clojure-russia (6)
- # clojure-spec (85)
- # clojure-taiwan (1)
- # clojure-uk (53)
- # clojurescript (96)
- # community-development (2)
- # cursive (4)
- # datomic (14)
- # emacs (41)
- # events (2)
- # hoplon (184)
- # leiningen (1)
- # nginx (1)
- # off-topic (16)
- # om (7)
- # onyx (63)
- # pedestal (27)
- # planck (17)
- # protorepl (3)
- # rdf (9)
- # re-frame (62)
- # reagent (7)
- # ring-swagger (5)
- # schema (2)
- # spacemacs (5)
- # test-check (25)
- # untangled (93)
- # yada (3)
i’m getting this error when trying to build an uberjar Caused by: java.lang.IllegalArgumentException: No matching ctor found for class io.pedestal.interceptor.helpers$before$fn__1340
@mrcnc I can help, but will need to look at some code with you. Can you share it here or would you prefer to go to a private chat?
Something in one of them is expanding out to a before
or defbefore
call at compilation time.
That "no matching ctor" message is what happens when there's a function value emitted as code from a macro. Often due to misplaced quoting.
Would you try something for me? Convert the defhandler
into just defn
on authenticate-user and authorize-user.
Piggybacking on @mtnygard's suggestion, I'll add that you should avoid using helpers like defhandler
because they can lead to weird compilation issues.
fns can be used as handlers because they extent the IntoInterceptor
protocol (https://github.com/pedestal/pedestal/blob/master/interceptor/src/io/pedestal/interceptor.clj#L33). This means that your usage of defhandler
isn't buying you anything over defn
.
so mtnygard that worked! and thx for the tip @ddeaguiar
Unfortunately I don't think the docs are very clear about staying away from some of the helpers.
Cool. I've run into trouble with macros and AOT many times before. Uberjar often hits AOT so I had a hunch.
@ddeaguiar Would you be willing to file an issue on that?
I build all my routes and interceptors at system start time, not at compile time. I don’t know if that’s pedestal’s recommended approach, but I find it much easier to reason about.