catnip icon indicating copy to clipboard operation
catnip copied to clipboard

Catnip doesn't work with Noir out of the box (class not found)

Open holyjak opened this issue 13 years ago • 2 comments
trafficstars

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

holyjak avatar Nov 10 '12 13:11 holyjak

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.

bodil avatar Nov 11 '12 23:11 bodil

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.

Raynes avatar Nov 12 '12 01:11 Raynes