catnip
catnip copied to clipboard
Catnip doesn't work with Noir out of the box (class not found)
Running lein edit on a fresh Noir project (lein new noir broken-prj; cd broken-prj; lein edit) fails with
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
...
at cheshire.custom__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
...
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.JsonFactory
...
at cheshire.factory__init.<clinit>(Unknown Source)
The workaround is to add an explicit dependency on cheshire 3.1.0 (that uses com.fasterxml.jackson.core/jackson-core) to the project.clj to override Noir's dependency on cheshire 3.0.0 (that claims to depend on org.codehaus.jackson/jackson-core-asl). I guess there is some conflict between what Catnip uses and what Noir uses?
Great piece of work, by the way! :-)
Versions: Lein 2, Catnip 0.4.1, Noir 1.3.0-beta3
Catnip uses Cheshire 4.0.2 as of the 0.4.1 release. Odd that an explicit dependency on Cheshire 3.1.0 should fix it, but such are the mysteries of the JVM classpath... A good fix would be one that hides Catnip's deps from the application overall, if possible, because many versions of Noir also have conflicting Hiccup deps (see #7).
While the bug needs fixing either way, I'd seriously recommend against using Noir in its current unmaintained state, though.
I imagine you could work around it by excluding the cheshire dependency from Noir.
I also wouldn't call it unmaintained. There aren't a huge number of bugs as it stands. I didn't realize the pull requests had piled up that much. I've merged a number of them, commented on the rest. I imagine Chris hasn't abandoned it (he is the type of guy who would be explicit if it were abandoned). Just got bigger fish to fry at the moment.
Of course, there are other reasons to use Compojure instead of Noir.