luminus-framework / luminus-template

a template project for the Luminus framework
http://www.luminusweb.net/
MIT License
648 stars 146 forks source link

+Swagger breaks templates: #112

Closed VFe closed 9 years ago

VFe commented 9 years ago

Just a heads up.

Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: {:formats (:json-kw :yaml-kw :edn :transit-json :transit-msgpack), :handle-error #<middleware$handle_req_error compojure.api.middleware$handle_req_error@7db8da6c>}, compiling:(services.clj:12:1)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3558)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3552)
    at clojure.lang.Compiler$DefExpr.eval(Compiler.java:417)
    at clojure.lang.Compiler.eval(Compiler.java:6708)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.RT.loadResourceScript(RT.java:370)
    at clojure.lang.RT.loadResourceScript(RT.java:361)
    at clojure.lang.RT.load(RT.java:440)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5066.invoke(core.clj:5641)
    at clojure.core$load.doInvoke(core.clj:5640)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5446)
    at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
    at clojure.core$load_lib.doInvoke(core.clj:5485)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$load_libs.doInvoke(core.clj:5524)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$require.doInvoke(core.clj:5607)
    at clojure.lang.RestFn.invoke(RestFn.java:930)
    at wtzzz.handler$eval3353$loading__4958__auto____3354.invoke(handler.clj:1)
    at wtzzz.handler$eval3353.invoke(handler.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6703)
    at clojure.lang.Compiler.eval(Compiler.java:6692)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.RT.loadResourceScript(RT.java:370)
    at clojure.lang.RT.loadResourceScript(RT.java:361)
    at clojure.lang.RT.load(RT.java:440)
    at clojure.lang.RT.load(RT.java:411)
    at clojure.core$load$fn__5066.invoke(core.clj:5641)
    at clojure.core$load.doInvoke(core.clj:5640)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5446)
    at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
    at clojure.core$load_lib.doInvoke(core.clj:5485)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$load_libs.doInvoke(core.clj:5524)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:626)
    at clojure.core$require.doInvoke(core.clj:5607)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at user$eval5.invoke(form-init1625203686011494445.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6703)
    at clojure.lang.Compiler.eval(Compiler.java:6692)
    at clojure.lang.Compiler.load(Compiler.java:7130)
    at clojure.lang.Compiler.loadFile(Compiler.java:7086)
    at clojure.main$load_script.invoke(main.clj:274)
    at clojure.main$init_opt.invoke(main.clj:279)
    at clojure.main$initialize.invoke(main.clj:307)
    at clojure.main$null_opt.invoke(main.clj:342)
    at clojure.main$main.doInvoke(main.clj:420)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalArgumentException: No value supplied for key: {:formats (:json-kw :yaml-kw :edn :transit-json :transit-msgpack), :handle-error #<middleware$handle_req_error compojure.api.middleware$handle_req_error@7db8da6c>}
    at clojure.lang.PersistentHashMap.create(PersistentHashMap.java:77)
    at ring.middleware.format_params$wrap_restful_params.doInvoke(format_params.clj:251)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at compojure.api.middleware$api_middleware.doInvoke(middleware.clj:140)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3553)
    ... 58 more
Subprocess failed
yogthos commented 9 years ago

I'm unable to reproduce, can you provide a bit more details on how you've produced the error?

VFe commented 9 years ago

I just do lein new luminus projectname +swagger and get that error on the first lein ring server

yogthos commented 9 years ago

I tried this on a couple of machines and don't see the issue. Have you checked your ~/.profile.clj to see if you might have some plugins loaded that may be interfering?

VFe commented 9 years ago

I tried it from another computer (both OSX Yosemite) and got the error as well, remoted into my home windows machine and didn't get the error.

I don't have any lein plugins installed on any of the machines.

Upgrading Leiningen to 2.4.3 and then doing another lein new luminous projectname +swagger fixed it on both machines. So it actually seems to be a leiningen problem? I believe I had 2.3.x before.

yogthos commented 9 years ago

That would definitely do it, I've only tested with the latest Leiningen 2.5.1 here.

VFe commented 9 years ago

Well, hopefully this issue helps the inevitable next guy to have this problem XD

yogthos commented 9 years ago

indeed, I think we can close this one then :)

mll commented 9 years ago

I experience this problem only when running from a war. I use newest lein (2.5.1 i suppose). The problem is certainly not fixed.

yogthos commented 9 years ago

This doesn't appear to be a luminus specific issue however, it might make more sense to open one up for compojure-api as that's where the issue happens.