fogus/marginalia — Issue #77: Exception in thread "main" java.lang.RuntimeException:
Author: acgetchell
Created: 2011-12-22 07:00:30+00:00
State: open

I managed to produce uberdoc.html before, but now I'm getting java errors:

Here are my files:

project.clj:

(defproject Newton "1.0.0-SNAPSHOT"
:description "Newtonian Approximation for Causal Dynamical Triangulations in Clojure"
:url "https://github.com/ucdavis/CDT"
:dependencies [[org.clojure/clojure "1.3.0"]]
:marginalia {:javascript["mathjax/MathJax.js"]}
:test-selectors {:default (fn [v] (not (:utilities v)))
:utilities :utilities
:all (fn [_] true)}
:dev-dependencies [[lein-ring "0.4.5"]
[lein-marginalia "0.6.1"]
[midje "1.3.1"]
[lein-midje "1.0.7"]])

core.clj:

(ns Newton.core)

simplex.clj:

(ns Newton.simplex
(:use midje.sweet))

;; # Load Optional Resources
;; Use external Javascript and CSS in your documentation. For example:
;; To format Latex math equations, download the
;; [MathJax](http://www.mathjax.org/) Javascript library to the docs
;; directory and then add
;;
;; :marginalia {:javascript ["mathjax/MathJax.js"]}
;;
;; to project.clj.
;;
;; When \\(a \ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are
;; $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

;; A simplex is a d-dimensional triangle. It has d+1 points and
;; $\left(\begin{array}{c}d+1\\2\end{array}\right)$ edges

utilities.clj:

(ns Newton.utilities
;; (:use [clojure.test])
(:use midje.sweet))

;; To keep same name conventions as utilities.lisp
;; In idiomatic clojure, this could be replaced by the anonymous function
;; \#(apply + %)
(defn sum
"Sums the elements of a list or vector"
[list]
(apply + list))

;; Usage/test of sum[...]
(fact (sum '(1 2 3)) => 6)
(fact (sum [1 2 3 4 5]) => 15)

Here are my steps to reproduce the problem:

PS C:\Projects\CDT\Newton> lein jar
No namespaces to :aot compile listed in project.clj.
Created C:\Projects\CDT\Newton/Newton-1.0.0-SNAPSHOT.jar
PS C:\Projects\CDT\Newton> lein midje
>>> clojure.test summary:
Ran 1 tests containing 2 assertions.
0 failures, 0 errors.
>>> Midje summary:
All claimed facts (2) have been confirmed.
PS C:\Projects\CDT\Newton> lein marg
Generating uberdoc for the following source files:
C:\Projects\CDT\Newton\.\src\Newton\core.clj
C:\Projects\CDT\Newton\.\src\Newton\simplex.clj
C:\Projects\CDT\Newton\.\src\Newton\utilities.clj

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeExceptio
n: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Integer c
annot be cast to clojure.lang.Named (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:458)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:174)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Run
timeException: java.lang.ClassCastException: java.lang.Integer cannot be cast to
clojure.lang.Named
at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:56)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.boundedLength(RT.java:1186)
at clojure.lang.RestFn.applyTo(RestFn.java:131)
at clojure.core$apply.invoke(core.clj:540)
at hiccup.core$eval612$fn__613.invoke(core.clj:99)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at clojure.lang.Var.invoke(Var.java:365)
at marginalia.html$toc_html.invoke(html.clj:178)
at marginalia.html$uberdoc_html.invoke(html.clj:390)
at marginalia.core$uberdoc_BANG_.invoke(core.clj:183)
at marginalia.core$run_marginalia.invoke(core.clj:235)
at leiningen.marg$marg.doInvoke(marg.clj:8)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at clojure.lang.Var.invoke(Var.java:365)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:259)
at leiningen.core$_main.doInvoke(core.clj:325)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:328)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Cla
ssCastException: java.lang.Integer cannot be cast to clojure.lang.Named
at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:56)
at clojure.lang.RT.seq(RT.java:450)
at clojure.core$seq.invoke(core.clj:122)
at clojure.core$map$fn__3695.invoke(core.clj:2088)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 38 more
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.I
nteger cannot be cast to clojure.lang.Named
at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:56)
at clojure.lang.RT.seq(RT.java:450)
at clojure.core$seq.invoke(core.clj:122)
at clojure.core$map$fn__3695.invoke(core.clj:2088)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 43 more
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to clo
jure.lang.Named
at clojure.core$name.invoke(core.clj:1245)
at marginalia.parser$fn__83.invoke(parser.clj:183)
at clojure.lang.MultiFn.invoke(MultiFn.java:171)
at marginalia.parser$dispatch_inner_form$fn__77.invoke(parser.clj:164)
at clojure.core$r.invoke(core.clj:799)
at marginalia.parser$dispatch_inner_form.invoke(parser.clj:162)
at marginalia.parser$fn__83.invoke(parser.clj:185)
at clojure.lang.MultiFn.invoke(MultiFn.java:171)
at marginalia.parser$dispatch_inner_form$fn__77.invoke(parser.clj:164)
at clojure.core$r.invoke(core.clj:799)
at marginalia.parser$dispatch_inner_form.invoke(parser.clj:162)
at marginalia.parser$fn__83.invoke(parser.clj:185)
at clojure.lang.MultiFn.invoke(MultiFn.java:171)
at marginalia.parser$dispatch_inner_form$fn__77.invoke(parser.clj:164)
at clojure.core$r.invoke(core.clj:799)
at marginalia.parser$dispatch_inner_form.invoke(parser.clj:162)
at marginalia.parser$fn__83.invoke(parser.clj:185)
at clojure.lang.MultiFn.invoke(MultiFn.java:171)
at marginalia.parser$extract_docstring.invoke(parser.clj:190)
at marginalia.parser$arrange_in_sections.invoke(parser.clj:237)
at marginalia.parser$parse.invoke(parser.clj:270)
at marginalia.parser$parse_file.invoke(parser.clj:276)
at marginalia.core$path_to_doc.invoke(core.clj:164)
at clojure.core$map$fn__3695.invoke(core.clj:2096)
at clojure.lang.LazySeq.sval(LazySeq.java:42)