How to read clojure stack trace? - clojure

I tried some clojure tutorial. I copied dependencies part to my project.clj. And I made a mistake. Instead of "1.6.0" version of clojure I put "1.7.0". You can see all 'dependencies' here:
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[compojure "1.3.1"]
[ring/ring-core "1.3.2" :exclusions [javax.servlet/servlet-api]]
[ring/ring-servlet "1.3.2" :exclusions [javax.servlet/servlet-api]]
[ring/ring-defaults "0.1.2" :exclusions [javax.servlet/servlet-api]]
[cc.qbits/jet "0.5.4"]]
With this mistake I got this after 'lein run':
Exception in thread "main" clojure.lang.ArityException: Wrong number of args (2) passed to: StringReader, compiling:(abnf.clj:189:28)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3628)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3622)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:439)
at clojure.lang.Compiler.eval(Compiler.java:6787)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.RT.loadResourceScript(RT.java:371)
at clojure.lang.RT.loadResourceScript(RT.java:362)
at clojure.lang.RT.load(RT.java:446)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:805)
at instaparse.core$eval9510$loading__5340__auto____9511.invoke(core.clj:1)
at instaparse.core$eval9510.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.eval(Compiler.java:6771)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.RT.loadResourceScript(RT.java:371)
at clojure.lang.RT.loadResourceScript(RT.java:362)
at clojure.lang.RT.load(RT.java:446)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clout.core$eval9504$loading__5340__auto____9505.invoke(core.clj:1)
at clout.core$eval9504.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.eval(Compiler.java:6771)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.RT.loadResourceScript(RT.java:371)
at clojure.lang.RT.loadResourceScript(RT.java:362)
at clojure.lang.RT.load(RT.java:446)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at compojure.core$eval9322$loading__5340__auto____9323.invoke(core.clj:1)
at compojure.core$eval9322.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.eval(Compiler.java:6771)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.RT.loadResourceScript(RT.java:371)
at clojure.lang.RT.loadResourceScript(RT.java:362)
at clojure.lang.RT.load(RT.java:446)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at server.core$eval20$loading__5340__auto____21.invoke(core.clj:1)
at server.core$eval20.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.eval(Compiler.java:6771)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.RT.loadResourceScript(RT.java:371)
at clojure.lang.RT.loadResourceScript(RT.java:362)
at clojure.lang.RT.load(RT.java:446)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval5$fn__7.invoke(form-init2532813080817058510.clj:1)
at user$eval5.invoke(form-init2532813080817058510.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.eval(Compiler.java:6772)
at clojure.lang.Compiler.load(Compiler.java:7227)
at clojure.lang.Compiler.loadFile(Compiler.java:7165)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$init_opt.invoke(main.clj:280)
at clojure.main$initialize.invoke(main.clj:308)
at clojure.main$null_opt.invoke(main.clj:343)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: clojure.lang.ArityException: Wrong number of args (2) passed to: StringReader
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.AFn.invoke(AFn.java:36)
at instaparse.cfg$eval10231$safe_read_string__10232.invoke(cfg.clj:163)
at instaparse.cfg$process_string.invoke(cfg.clj:180)
at instaparse.cfg$build_rule.invoke(cfg.clj:217)
at clojure.core$map$fn__4553.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4128.invoke(core.clj:137)
at clojure.core$apply.invoke(core.clj:630)
at instaparse.cfg$build_rule.invoke(cfg.clj:215)
at clojure.core$map$fn__4553.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4128.invoke(core.clj:137)
at clojure.core$apply.invoke(core.clj:630)
at instaparse.cfg$build_rule.invoke(cfg.clj:211)
at instaparse.cfg$build_rule.invoke(cfg.clj:214)
at clojure.core$map$fn__4553.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4128.invoke(core.clj:137)
at clojure.core$apply.invoke(core.clj:630)
at instaparse.cfg$build_rule.invoke(cfg.clj:215)
at clojure.core$map$fn__4553.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4128.invoke(core.clj:137)
at clojure.core$apply.invoke(core.clj:630)
at instaparse.cfg$build_rule.invoke(cfg.clj:211)
at instaparse.cfg$build_rule.invoke(cfg.clj:207)
at clojure.core$map$fn__4553.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4128.invoke(core.clj:137)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30)
at clojure.core.protocols$fn__6506.invoke(protocols.clj:101)
at clojure.core.protocols$fn__6452$G__6447__6465.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6519)
at clojure.core$into.invoke(core.clj:6600)
at instaparse.cfg$ebnf.invoke(cfg.clj:277)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3623)
... 125 more
So It took some time to realize that I have wrong clojure version.
And for this mistake was absolutly not clear from stack trace that I got.
Does anybody can help explain me what does this stack traces actually tells? How I should understand that clojure version is not good? BTW Why it is not good version?

That stacktrace is unfortunate. It doesn't help much in understanding what's happening. The most we can say without digging too deep is "something is wrong while compiling instaparse". You don't have to know what instaparse is, but it's used by compojure.
The thing is: the clojure version is not wrong. It's just that compojure 1.3.1 is not compatible with clojure 1.7.0. Clojure 1.7.0 is the last stable version. You can use 1.6.0 or 1.7.0. It's just that if you are going to use clojure 1.7.0, then the compojure version is wrong (of course you didn't have to know that). Try with [compojure "1.3.4"] on clojure 1.7.0, everything should be fine.
From Clojure Stack Traces for the Uninitiated I'll take some guidance when facing with a clojure stacktrace:
Find the ultimate cause: Find the last line that starts with "Caused by". That's where the exception originated.
Look for your namespace (and I'll add, if there's any, look for a namespace different than "clojure"): In this case, it will make us to say "oh, something is wrong with instaparse!".
Break out your decoder ring (or find the $ sign): Here we have a bit of knowledge on how clojure compiles our code. One important thing to know is that every function is compiled into a separate class, and many times we can identify the function by what's following the $ sign. In this case, from instaparse.cfg$process_string.invoke(cfg.clj:180) we can assume the issue is in the line 180 of cfg.clj in instaparse, where the process_string* function is defined.
* most probably it's process-string because of name munging, but that's another story.

Related

Syntax error compiling in Clojure leiningen

I have a project named cheshire-cat in which I am trying to run Rhino-based ClojureScript REPL with the command lein trampoline cljsbuild repl-rhino. It gives an exception in thread "main" and terminates.
What is the problem? Following is the terminal output:
$lein trampoline cljsbuild repl-rhino
Running Rhino-based ClojureScript REPL.
Exception in thread "main" Syntax error compiling at (cljs/repl.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7647)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at cljsbuild.repl.rhino$eval144$loading__6706__auto____145.invoke(rhino.clj:1)
at cljsbuild.repl.rhino$eval144.invokeStatic(rhino.clj:1)
at cljsbuild.repl.rhino$eval144.invoke(rhino.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval5.invokeStatic(form-init5565266544074168037.clj:1)
at user$eval5.invoke(form-init5565266544074168037.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:495)
at java.base/java.lang.Class.forName(Class.java:474)
at clojure.lang.RT.classForName(RT.java:2207)
at clojure.lang.RT.classForNameNonLoading(RT.java:2220)
at cljs.repl$eval150$loading__6706__auto____151.invoke(repl.clj:9)
at cljs.repl$eval150.invokeStatic(repl.clj:9)
at cljs.repl$eval150.invoke(repl.clj:9)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
... 67 more
This is my project.clj file:
(defproject cheshire-cat "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.10.0"]
[compojure "1.6.1"]
[ring/ring-defaults "0.3.2"]
[ring/ring-json "0.5.1"]
[org.clojure/clojurescript "0.0-2371"]]
:plugins [[lein-ring "0.12.6"]
[lein-cljsbuild "1.1.8"]]
:ring {:handler cheshire-cat.handler/app}
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring/ring-mock "0.3.2"]]}}
:cljsbuild {
:builds [{
:source-paths ["src-cljs"]
:compiler {
:output-to "resources/public/main.js"
:optimizations :whitespace
:pretty-print true}}]})
I tried to change the dependencies version to make it work but it didn't.
How to remove this error and make the command run the REPL without any error. Thanks.
This is an issue with using newer JDKs (9+) with older software that used some packages only available until JDK8. You can fix this by adding
[javax.xml.bind/jaxb-api "2.3.1"]
to your :dependencies in project.clj.
It's not about dependencies, it's about the JDK version: https://stackoverflow.com/a/43574427/564509
And there's already an issue for that: https://github.com/emezeske/lein-cljsbuild/issues/499

Clojure: Lein figwheel and ClassNotFoundException: javax.xml.bind.DatatypeConverter

I'm trying to run lein figwheel on a ClojureScript app and I keep getting this error:
Exception in thread "main" java.lang.ClassNotFoundException:
javax.xml.bind.DatatypeConverter, compiling:(cljs/closure.clj:1:1) at
clojure.lang.Compiler.load(Compiler.java:7391) at
clojure.lang.RT.loadResourceScript(RT.java:372) at
clojure.lang.RT.loadResourceScript(RT.java:363) at
clojure.lang.RT.load(RT.java:453) at
clojure.lang.RT.load(RT.java:419) at
clojure.core$load$fn__5677.invoke(core.clj:5893) at
clojure.core$load.invokeStatic(core.clj:5892) at
clojure.core$load.doInvoke(core.clj:5876) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
clojure.core$load_one.invokeStatic(core.clj:5697) at
clojure.core$load_one.invoke(core.clj:5692) at
clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at
clojure.core$load_lib.invokeStatic(core.clj:5736) at
clojure.core$load_lib.doInvoke(core.clj:5717) at
clojure.lang.RestFn.applyTo(RestFn.java:142) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$load_libs.invokeStatic(core.clj:5774) at
clojure.core$load_libs.doInvoke(core.clj:5758) at
clojure.lang.RestFn.applyTo(RestFn.java:137) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$require.invokeStatic(core.clj:5796) at
clojure.core$require.doInvoke(core.clj:5796) at
clojure.lang.RestFn.invoke(RestFn.java:3204) at
cljs.repl$eval10915$loading__5569__auto____10916.invoke(repl.cljc:9)
at cljs.repl$eval10915.invokeStatic(repl.cljc:9) at
cljs.repl$eval10915.invoke(repl.cljc:9) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) at
clojure.lang.RT.loadResourceScript(RT.java:372) at
clojure.lang.RT.loadResourceScript(RT.java:363) at
clojure.lang.RT.load(RT.java:453) at
clojure.lang.RT.load(RT.java:419) at
clojure.core$load$fn__5677.invoke(core.clj:5893) at
clojure.core$load.invokeStatic(core.clj:5892) at
clojure.core$load.doInvoke(core.clj:5876) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
clojure.core$load_one.invokeStatic(core.clj:5697) at
clojure.core$load_one.invoke(core.clj:5692) at
clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at
clojure.core$load_lib.invokeStatic(core.clj:5736) at
clojure.core$load_lib.doInvoke(core.clj:5717) at
clojure.lang.RestFn.applyTo(RestFn.java:142) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$load_libs.invokeStatic(core.clj:5774) at
clojure.core$load_libs.doInvoke(core.clj:5758) at
clojure.lang.RestFn.applyTo(RestFn.java:137) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$require.invokeStatic(core.clj:5796) at
clojure.core$require.doInvoke(core.clj:5796) at
clojure.lang.RestFn.invoke(RestFn.java:1523) at
figwheel_sidecar.repl$eval10909$loading__5569__auto____10910.invoke(repl.clj:1)
at figwheel_sidecar.repl$eval10909.invokeStatic(repl.clj:1) at
figwheel_sidecar.repl$eval10909.invoke(repl.clj:1) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) at
clojure.lang.RT.loadResourceScript(RT.java:372) at
clojure.lang.RT.loadResourceScript(RT.java:363) at
clojure.lang.RT.load(RT.java:453) at
clojure.lang.RT.load(RT.java:419) at
clojure.core$load$fn__5677.invoke(core.clj:5893) at
clojure.core$load.invokeStatic(core.clj:5892) at
clojure.core$load.doInvoke(core.clj:5876) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
clojure.core$load_one.invokeStatic(core.clj:5697) at
clojure.core$load_one.invoke(core.clj:5692) at
clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at
clojure.core$load_lib.invokeStatic(core.clj:5736) at
clojure.core$load_lib.doInvoke(core.clj:5717) at
clojure.lang.RestFn.applyTo(RestFn.java:142) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$load_libs.invokeStatic(core.clj:5774) at
clojure.core$load_libs.doInvoke(core.clj:5758) at
clojure.lang.RestFn.applyTo(RestFn.java:137) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$require.invokeStatic(core.clj:5796) at
clojure.core$require.doInvoke(core.clj:5796) at
clojure.lang.RestFn.invoke(RestFn.java:1523) at
figwheel_sidecar.system$eval10903$loading__5569__auto____10904.invoke(system.clj:1)
at figwheel_sidecar.system$eval10903.invokeStatic(system.clj:1) at
figwheel_sidecar.system$eval10903.invoke(system.clj:1) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) at
clojure.lang.RT.loadResourceScript(RT.java:372) at
clojure.lang.RT.loadResourceScript(RT.java:363) at
clojure.lang.RT.load(RT.java:453) at
clojure.lang.RT.load(RT.java:419) at
clojure.core$load$fn__5677.invoke(core.clj:5893) at
clojure.core$load.invokeStatic(core.clj:5892) at
clojure.core$load.doInvoke(core.clj:5876) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
clojure.core$load_one.invokeStatic(core.clj:5697) at
clojure.core$load_one.invoke(core.clj:5692) at
clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at
clojure.core$load_lib.invokeStatic(core.clj:5736) at
clojure.core$load_lib.doInvoke(core.clj:5717) at
clojure.lang.RestFn.applyTo(RestFn.java:142) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$load_libs.invokeStatic(core.clj:5774) at
clojure.core$load_libs.doInvoke(core.clj:5758) at
clojure.lang.RestFn.applyTo(RestFn.java:137) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$require.invokeStatic(core.clj:5796) at
clojure.core$require.doInvoke(core.clj:5796) at
clojure.lang.RestFn.invoke(RestFn.java:930) at
figwheel_sidecar.repl_api$eval9$loading__5569__auto____10.invoke(repl_api.clj:1)
at figwheel_sidecar.repl_api$eval9.invokeStatic(repl_api.clj:1) at
figwheel_sidecar.repl_api$eval9.invoke(repl_api.clj:1) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) at
clojure.lang.RT.loadResourceScript(RT.java:372) at
clojure.lang.RT.loadResourceScript(RT.java:363) at
clojure.lang.RT.load(RT.java:453) at
clojure.lang.RT.load(RT.java:419) at
clojure.core$load$fn__5677.invoke(core.clj:5893) at
clojure.core$load.invokeStatic(core.clj:5892) at
clojure.core$load.doInvoke(core.clj:5876) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
clojure.core$load_one.invokeStatic(core.clj:5697) at
clojure.core$load_one.invoke(core.clj:5692) at
clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at
clojure.core$load_lib.invokeStatic(core.clj:5736) at
clojure.core$load_lib.doInvoke(core.clj:5717) at
clojure.lang.RestFn.applyTo(RestFn.java:142) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$load_libs.invokeStatic(core.clj:5774) at
clojure.core$load_libs.doInvoke(core.clj:5758) at
clojure.lang.RestFn.applyTo(RestFn.java:137) at
clojure.core$apply.invokeStatic(core.clj:648) at
clojure.core$require.invokeStatic(core.clj:5796) at
clojure.core$require.doInvoke(core.clj:5796) at
clojure.lang.RestFn.invoke(RestFn.java:408) at
user$eval5.invokeStatic(form-init1038311299988387512.clj:1) at
user$eval5.invoke(form-init1038311299988387512.clj:1) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) at
clojure.lang.Compiler.loadFile(Compiler.java:7317) at
clojure.main$load_script.invokeStatic(main.clj:275) at
clojure.main$init_opt.invokeStatic(main.clj:277) at
clojure.main$init_opt.invoke(main.clj:277) at
clojure.main$initialize.invokeStatic(main.clj:308) at
clojure.main$null_opt.invokeStatic(main.clj:342) at
clojure.main$null_opt.invoke(main.clj:339) at
clojure.main$main.invokeStatic(main.clj:421) at
clojure.main$main.doInvoke(main.clj:384) at
clojure.lang.RestFn.invoke(RestFn.java:421) at
clojure.lang.Var.invoke(Var.java:383) at
clojure.lang.AFn.applyToHelper(AFn.java:156) at
clojure.lang.Var.applyTo(Var.java:700) at
clojure.main.main(main.java:37) Caused by:
java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter at
java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at
clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at
clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method) at
java.base/java.lang.Class.forName(Class.java:398) at
clojure.lang.RT.classForName(RT.java:2168) at
clojure.lang.RT.classForNameNonLoading(RT.java:2181) at
cljs.closure$eval12201$loading__5569__auto____12202.invoke(closure.clj:9)
at cljs.closure$eval12201.invokeStatic(closure.clj:9) at
cljs.closure$eval12201.invoke(closure.clj:9) at
clojure.lang.Compiler.eval(Compiler.java:6927) at
clojure.lang.Compiler.eval(Compiler.java:6916) at
clojure.lang.Compiler.load(Compiler.java:7379) ... 153 more
I've checked my dev environment and confirmed I'm running Java 11 and that I have the latest version of lein. The little info I can find online is that this was a Java 9 issue, but there's nothing else past that. Any idea how to fix this?
I only add [javax.xml.bind/jaxb-api "2.3.0"] into my :dependencies of the project.clj according to https://stackoverflow.com/a/53039959/5022162this post, then it would be worked well.
I had this problem a few months ago. Do a lein deps :tree. One of your dependencies is using an outdated lib. You should also be using the lein-ancient plugin to make sure all of your direct dependencies are up-to-date.
Once you upgrade all your libs, the problem should go away. If it is a 3rd level dep including an outdated lib, put that lib (with newest version) at the top of your lein :dependencies (lein follows the rule "first one wins" when multiple deps versions are present).
In addition, you should consider upgrading to Figwheel-Main. It is much easier to use than the original figwheel. It also allows you to use the Clojure Deps build system instead of lein, which will also greatly simplify your CLJS development.
After the modularization of JDK released with Java 9 certain parts of it are no longer available within the standard bundle.
This is the case of javax.xml.bind.DatatypeConverter which resides in the java.xml.bind module.
It might be that it's just a simple upgrade to the latest libs/tools you use but in case you actually need that dependency you should specify it as a java arg: --add-modules java.xml.bind (see How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9 for more deteails).
I had the same issue, ran lein ancient (without making changes), then did lein figwheel and suddenly it worked?!? Not sure what made the difference.

lein ritz setup error

I am trying to setup ritz/lein/emacs etc to create a clojure dev environment.
I installed lein plugin install lein-ritz "0.5.0" and added it to my project file. When trying lein ritz I get this exception:
arash#azure:~/programming/onebreaker$ lein ritz
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.io.FileNotFoundException: Could not locate leiningen/core/eval_init.class or leiningen/core/eval.clj on classpath: (ritz.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5415)
at clojure.lang.Compiler.load(Compiler.java:5857)
at clojure.lang.RT.loadResourceScript(RT.java:340)
at clojure.lang.RT.loadResourceScript(RT.java:331)
at clojure.lang.RT.load(RT.java:409)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn_4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:4729)
at clojure.core$load_lib.doInvoke(core.clj:4766)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$load_libs.doInvoke(core.clj:4800)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$require.doInvoke(core.clj:4881)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at leiningen.core$resolve_task.invoke(core.clj:208)
at leiningen.core$apply_task.invoke(core.clj:258)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
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:457)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
... 5 more
Caused by: java.io.FileNotFoundException: Could not locate leiningen/core/eval_init.class or leiningen/core/eval.clj on classpath:
at clojure.lang.RT.load(RT.java:412)
at clojure.lang.RT.load(RT.java:381)
at clojure.core$load$fn_4519.invoke(core.clj:4915)
at clojure.core$load.doInvoke(core.clj:4914)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:4729)
at clojure.core$load_lib.doInvoke(core.clj:4766)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$load_libs.doInvoke(core.clj:4800)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:542)
at clojure.core$require.doInvoke(core.clj:4881)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at leiningen.ritz$eval68$loading_4414_auto____69.invoke(ritz.clj:1)
at leiningen.ritz$eval68.invoke(ritz.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 44 more
Can you helo me to resolve this?
Have you tried leinigen2?
I'm using leiningen 2.0.0-review10 and have the following in my ~/.lein/profiles.clj file:
{:user {:plugins [
;;...
[lein-ritz "0.5.0"]
;;...
]}}
Running lein ritz results in:
user=> Swank server listening on local port 61428

Encountering errors when "lein new" is executed (on windows)

Other commands such as lein repl and lein deps etc work fine.
The output is as follows
C:\Users\test>lein version
Leiningen 2.0.0-preview3 on Java 1.7.0 Java HotSpot(TM) 64-Bit Server VM
C:\Users\test>lein new first
Generating a project called first based on the 'default' template.
java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory f
ound for class: nil
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:495)
at clojure.java.io$fn_7795$G_7790__7802.invoke(io.clj:63)
at clojure.java.io$reader.doInvoke(io.clj:96)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at leiningen.new.templates$slurp_resource.invoke(templates.clj:29)
at leiningen.new.templates$renderer$fn__713.doInvoke(templates.clj:79)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.new.default$default.invoke(default.clj:15)
at clojure.lang.Var.invoke(Var.java:401)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.core$apply.invoke(core.clj:602)
at leiningen.new$create.doInvoke(new.clj:54)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.new$create.invoke(new.clj:47)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:600)
at leiningen.new$new.doInvoke(new.clj:101)
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.core$apply.invoke(core.clj:602)
at leiningen.core.main$resolve_task$fn__699.doInvoke(main.clj:66)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at leiningen.core.main$apply_task.invoke(main.clj:88)
at leiningen.core.main$main$fn_731.invoke(main.clj:140)
at leiningen.core.main$_main.doInvoke(main.clj:140)
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.core$apply.invoke(core.clj:600)
at clojure.main$main_opt.invoke(main.clj:323)
at clojure.main$main.doInvoke(main.clj:426)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:413)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.main.main(main.java:37)
I experienced a similar issue and solved it by switching to lein 1.7.1.
Try downloading https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat, and running:
lein self-install

Confusing Clojure Compile Errors -- Bad line reporting?

I am getting compile errors while running lein run on my Noir project. It was working, and then suddenly it stopped working. My suspicion was that the error is connected with trying to include [org.pegdown/pegdown "1.1.0"] in my dependencies vector in the project file, but I don't know for sure. I removed that line, ran lein clean; lein deps and then tried lein run again, but the error persists.
Below are two separate errors that I get. I don't know what triggers either error. All my files (in the namespace "benekastah") report an error at line 1, which is typically a normal ns call.
The second error seems to indicate that the problem is in post_modify.clj, but that was working before and I haven't changed it.
I tried the solution found here and it didn't seem to work.
Any insight into these confusing errors?
Error 1:
Exception in thread "main" java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval1.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6454)
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.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at benekastah.views.common$loading__4505__auto__.invoke(common.clj:1)
at benekastah.views.common__init.load(Unknown Source)
at benekastah.views.common__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at benekastah.views.blog.index$loading__4505__auto__.invoke(index.clj:1)
at benekastah.views.blog.index__init.load(Unknown Source)
at benekastah.views.blog.index__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at noir.server$load_views.doInvoke(server.clj:25)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at benekastah.server$eval10.invoke(server.clj:5)
at clojure.lang.Compiler.eval(Compiler.java:6465)
... 31 more
Caused by: java.lang.NullPointerException
at clojure.core$refer.doInvoke(core.clj:3775)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_lib.doInvoke(core.clj:5252)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at benekastah.css.base__init.load(Unknown Source)
at benekastah.css.base__init.<clinit>(Unknown Source)
... 92 more
Error 2:
Exception in thread "main" java.lang.NullPointerException, compiling:(post_modify.clj:1)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3342)
at clojure.lang.Compiler.compile1(Compiler.java:6985)
at clojure.lang.Compiler.compile1(Compiler.java:6975)
at clojure.lang.Compiler.compile(Compiler.java:7046)
at clojure.lang.RT.compile(RT.java:385)
at clojure.lang.RT.load(RT.java:425)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at noir.server$load_views.doInvoke(server.clj:25)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3337)
at clojure.lang.Compiler.compile1(Compiler.java:6985)
at clojure.lang.Compiler.compile(Compiler.java:7046)
at clojure.lang.RT.compile(RT.java:385)
at clojure.lang.RT.load(RT.java:425)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$compile$fn__4615.invoke(core.clj:5397)
at clojure.core$compile.invoke(core.clj:5396)
at user$eval27.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.NullPointerException
at clojure.lang.Compiler$ObjExpr.emitVar(Compiler.java:4728)
at clojure.lang.Compiler$DefExpr.emit(Compiler.java:395)
at clojure.lang.Compiler.compile1(Compiler.java:6984)
at clojure.lang.Compiler.compile(Compiler.java:7046)
at clojure.lang.RT.compile(RT.java:385)
at clojure.lang.RT.load(RT.java:425)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at benekastah.views.blog.post_modify$loading__4505__auto__.invoke(post_modify.clj:1)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3337)
... 46 more
Exception in thread "main" java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$eval1.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6454)
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.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at benekastah.views.common$loading__4505__auto__.invoke(common.clj:1)
at benekastah.views.common__init.load(Unknown Source)
at benekastah.views.common__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at benekastah.views.blog.index$loading__4505__auto__.invoke(index.clj:1)
at benekastah.views.blog.index__init.load(Unknown Source)
at benekastah.views.blog.index__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.loadClassForName(RT.java:2030)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at noir.server$load_views.doInvoke(server.clj:25)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at benekastah.server$eval10.invoke(server.clj:5)
at clojure.lang.Compiler.eval(Compiler.java:6465)
... 31 more
Caused by: java.lang.NullPointerException
at clojure.core$refer.doInvoke(core.clj:3775)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_lib.doInvoke(core.clj:5252)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at benekastah.css.base__init.load(Unknown Source)
at benekastah.css.base__init.<clinit>(Unknown Source)
... 92 more
benekastah.views.blog.post_modify.clj
(ns benekastah.views.blog.post-modify
(:require [noir.response :as resp]
[somnium.congomongo :as congo]
[clj-time.core :as time]
[clj-time.format :as time-format]
[clj-time.coerce :as time-coerce]
[clojure.string :as cl-string]
[benekastah.lib.string :as b-string])
(:use noir.core
benekastah.models.db))
(defn- save-post
[post]
(try (save! :post post)
(resp/redirect "/")
(catch Exception e
{:status 500
:body (str "Could not save post: " e)})))
(defpage [:post "/post"] [& param-lists]
(let [params (populate-defaults
:post
(apply hash-map (apply concat param-lists)))
{date :date, title :title } params
slug (str
(time-format/unparse
(time-format/formatters :date)
(time-coerce/from-date date))
"_"
(cl-string/replace (cl-string/trim title)
#"[^\w\-]"
"_"))
p (merge params {:slug slug})]
(save-post p)))
(defpage [:put "/post"] {:keys [id]}
(let [post (congo/fetch-by-id id)]
(save-post post)))
(defpage [:delete "/post"] {:keys [id]}
(let [post (congo/fetch-by-id id)]
(congo/destroy! :post post)))
This is caused when a function in a namespace replaces a core function, like get. You can find some discussion of it on the clojure-dev mailing list here. The solution, rather than renaming your functions is to place (:refer-clojure :exclude [name-of-replaced-function]) in your ns form.
I had a similar problem, and I actually got to the root of it. Turns out that I had my own get and remove function definitions in my code. This was somehow interfering with clojure.core's get and remove function definitions in that namespace. Those NPE (on compilation) were the result. To fix the problem, all I did was rename my function definitions to getk and removek.
HTH
Here's how I "fixed" my problem: In response to #Alex's comment suggesting I look at benekastah.css.base, I commented out the bulk of that file and restarted the server. At this point, the error message pointed to benekastah.css.blog, where I commented out the bulk of the file again. Then the error message pointed to benekastah.css.theme (the last file in the benekastah.css.* group), at which point I took the same steps as with the other two files. Then the server worked. So, working backwords, I uncommented the code in each file, and everything seems to be running fine again. I also was able to add the dependency back in to pegdown. Weird.
If anyone has any insight to the way that clojure, leiningen or java works that would result in any of this making sense, I would be interested to hear it.
For the record, I am using cssgen for my benekastah.css.* files. It seems to be working fine for the most part.