marginalia
marginalia copied to clipboard
Errors are incomprehensible
I am trying to run marginalia against my source tree but I'm getting incomprehensible error messages and I have no hint as to how to fix them. I tried Clojure 1.2 and 1.3 - and got different errors.
Here's the errors when run with Clojure 1.3:
Generating uberdoc for the following source files: /Users/will/Code/parse_perseus/src/parse_perseus/api.clj /Users/will/Code/parse_perseus/src/parse_perseus/betacode.clj /Users/will/Code/parse_perseus/src/parse_perseus/book.clj /Users/will/Code/parse_perseus/src/parse_perseus/core.clj Warning: *coercions* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *coercions* or change the name. Warning: *sandbar-session* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *sandbar-session* or change the name. Warning: *impl-name* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *impl-name* or change the name. Warning: clojure.contrib.logging/*impl-name* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic clojure.contrib.logging/*impl-name* or change the name. Warning: *logging-agent* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *logging-agent* or change the name. Warning: *allow-direct-logging* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *allow-direct-logging* or change the name. Warning: *old-std-streams* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *old-std-streams* or change the name. Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Map literal must contain an even number of forms at clojure.lang.LispReader.read(LispReader.java:215) at marginalia.parser$parse_STAR_$fn__493$fn__496.invoke(parser.clj:115) at marginalia.parser$parse_STAR_$fn__493.invoke(parser.clj:114) at clojure.core$repeatedly$fn__4304.invoke(core.clj:4518) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.RT.seq(RT.java:466) at clojure.core$seq.invoke(core.clj:133) at clojure.core$map$fn__3811.invoke(core.clj:2424) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.Cons.next(Cons.java:39) at clojure.lang.RT.next(RT.java:580) at clojure.core$next.invoke(core.clj:64) at clojure.core$concat$cat__3530$fn__3531.invoke(core.clj:677) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.RT.seq(RT.java:466) at clojure.core$seq.invoke(core.clj:133) at clojure.core$filter$fn__3830.invoke(core.clj:2468) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.RT.seq(RT.java:466) at clojure.core$seq.invoke(core.clj:133) at clojure.core$take_while$fn__3840.invoke(core.clj:2509) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.Cons.next(Cons.java:39) at clojure.lang.RT.next(RT.java:580) at clojure.core$next.invoke(core.clj:64) at clojure.core$dorun.invoke(core.clj:2724) at clojure.core$doall.invoke(core.clj:2739) at marginalia.parser$parse.invoke(parser.clj:326) at marginalia.parser$parse_file.invoke(parser.clj:336) at marginalia.core$path_to_doc.invoke(core.clj:164) at clojure.core$map$fn__3811.invoke(core.clj:2432) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.RT.seq(RT.java:466) at clojure.core$seq.invoke(core.clj:133) at clojure.core$map$fn__3811.invoke(core.clj:2424) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.RT.seq(RT.java:466) at clojure.core$seq.invoke(core.clj:133) at clojure.core$map$fn__3811.invoke(core.clj:2424) at clojure.lang.LazySeq.sval(LazySeq.java:42) at clojure.lang.LazySeq.seq(LazySeq.java:60) at clojure.lang.Cons.next(Cons.java:39) at clojure.lang.RT.boundedLength(RT.java:1607) at clojure.lang.RestFn.applyTo(RestFn.java:130) at clojure.core$apply.invoke(core.clj:600) at hiccup.core$eval49$fn__50.invoke(core.clj:99) at clojure.lang.MultiFn.invoke(MultiFn.java:163) at clojure.lang.Var.invoke(Var.java:401) at marginalia.html$toc_html.invoke(html.clj:188) at marginalia.html$uberdoc_html.invoke(html.clj:401) at marginalia.core$uberdoc_BANG_.invoke(core.clj:197) at marginalia.core$run_marginalia.doInvoke(core.clj:278) at clojure.lang.RestFn.invoke(RestFn.java:410) at user$eval862.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:6465) at clojure.lang.Compiler.eval(Compiler.java:6455) at clojure.lang.Compiler.eval(Compiler.java:6431) at clojure.core$eval.invoke(core.clj:2795) at clojure.main$eval_opt.invoke(main.clj:296) at clojure.main$initialize.invoke(main.clj:315) at clojure.main$null_opt.invoke(main.clj:348) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:405) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37) Caused by: java.lang.RuntimeException: Map literal must contain an even number of forms at clojure.lang.Util.runtimeException(Util.java:156) at clojure.lang.LispReader$MapReader.invoke(LispReader.java:1071) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$VectorReader.invoke(LispReader.java:1061) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.readDelimitedList(LispReader.java:1126) at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962) at clojure.lang.LispReader.read(LispReader.java:180) ... 73 more
There is no hint as to which file generated this error or which line number it was on. Same with the warning messages - what do they relate to?
What version of Marginalia are you using? Likewise, how are you executing it? Do you have code that we could look at?
-
Checkout the code:
git clone https://[email protected]/wjlroe/parse_perseus.git
lein deps
-
Marginalia version is "0.7.0-SNAPSHOT"
-
Run marginalia:
lein marg
-
The error stack trace is huge so I'll paste it here: http://pastebin.com/NuBRtpES
I'm having all sorts of other problems with Clojure 1.3 so this is 1.2.
The main error I get is "Caused by: clojure.lang.LispReader$ReaderException: java.lang.IllegalArgumentException: Duplicate key: :xmlns" Which is in book.clj - problem is the stacktrace doesn't indicate where the error is or what it really means. The code compiles and works fine - so it's something related to the way Marginalia works.
I just got the 'Map literal' error. It seems to be related to parsing the following map literal:
{:xlink:href link :target "_top"}
I guess it's parsing the keyword with the colon in the middle as two separate keys (although, again, the code compiles and works fine)
Here are failing/passing test cases to illustrate the problem:
Failing:
(ns test-fail)
(def test {:xmlns:test "http://example.com/"})
output is:
Problem parsing near line 2 <)> original reported cause is java.lang.RuntimeException: Map literal must contain an even number of forms
Passing:
(ns test-pass)
(def test {:xmlns_test "http://example.com/"})
(Running with lein marg
if that makes any difference.)
This was duplicated with #165 but I still think it might be worth exploring making the error messages better