Closed smahood closed 9 years ago
You'd have to use lein ring uberwar
to build a war archive using the lein-ring
plugin.
Yeah, that was a mistake in the issue text only - I used lein ring uberwar
to make a war archive.
Fixed in issue description, sorry about that.
OK I can reproduce the issue and it appears to be a problem with the compojure-api library that's pulled in with the +swagger
profile. A base project without it doesn't exhibit the issue. So, might make sense to open issue for it instead.
Ok, will see if I can get it sorted there and will follow up here when fixed. Thanks!
I finally solved this issue.
There is a library name conflict between
https://github.com/ngrunwald/ring-middleware-format
and
https://github.com/metosin/ring-middleware-format
compojure-api comes from metosin as well and depends on the latter while luminus had (i dont see it now) a dependency on the former. Therefore, it was completely undeterministic when which of them would be included and seems that uberjar was leaning towards importing the former, which is wrong and breaks compojure-api. So, just delete all references to ring-middleware-format in your project.clj and all should work fine (compojure would force fetching of the proper library anyway)
Ah ok yeah, the middleware-format library used to have a different maintainer, I started using it in Luminus before it moved to metosin, so older versions of the template would have it instead.
I'm having trouble getting 'lein ring uberwar' to create a file that will work in either Jetty or Tomcat.
Reproducible steps:
lein new luminus test +swagger
Go into test directorylein ring server
works finelein ring uberwar
Copy war file into jetty webapps folder Start jetty usingjava -jar start.jar
Get error in console in formjava.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@262d72a>}, compiling:(services.clj:12:1)
...This is running on Windows 10 preview, using Leiningen 2.5.1 on Java 1.8.0_31 Java HotSpot(TM) 64-Bit Server VM
Any ideas?