I have Leiningen installed on my computer here: /usr/local/bin/lein (version 2.7.1)
I have Java installed here: /usr/bin/java (version 1.8.0_74)
I have set Leiningen it to be executable, and yet when I go to run "lein", I get the following error message:
"java.lang.Exception: Error loading /Users/jessierichardson/Desktop/project.clj
at leiningen.core.project$read_raw$fn__6407.invoke (project.clj:962)
leiningen.core.project$read_raw.invokeStatic (project.clj:956)
leiningen.core.project$read_raw.invoke (project.clj:952)
leiningen.core.project$read.invokeStatic (project.clj:973)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.project$read.invokeStatic (project.clj:974)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.main$_main$fn__5998.invoke (main.clj:397)
leiningen.core.main$_main.invokeStatic (main.clj:394)
leiningen.core.main$_main.doInvoke (main.clj:391)
clojure.lang.RestFn.invoke (RestFn.java:397)
clojure.lang.Var.invoke (Var.java:375)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invokeStatic (core.clj:646)
clojure.main$main_opt.invokeStatic (main.clj:314)
clojure.main$main_opt.invoke (main.clj:310)
clojure.main$main.invokeStatic (main.clj:421)
clojure.main$main.doInvoke (main.clj:384)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
Caused by: clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: bookmark88 in this context, compiling:(/Users/jessierichardson/Desktop/project.clj:0:0)
at clojure.lang.Compiler.analyze (Compiler.java:6688)
clojure.lang.Compiler.analyze (Compiler.java:6625)
clojure.lang.Compiler.eval (Compiler.java:6931)
clojure.lang.Compiler.load (Compiler.java:7379)
clojure.lang.Compiler.loadFile (Compiler.java:7317)
clojure.lang.RT$3.invoke (RT.java:320)
leiningen.core.project$read_raw$fn__6407.invoke (project.clj:960)
leiningen.core.project$read_raw.invokeStatic (project.clj:956)
leiningen.core.project$read_raw.invoke (project.clj:952)
leiningen.core.project$read.invokeStatic (project.clj:973)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.project$read.invokeStatic (project.clj:974)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.main$_main$fn__5998.invoke (main.clj:397)
leiningen.core.main$_main.invokeStatic (main.clj:394)
leiningen.core.main$_main.doInvoke (main.clj:391)
clojure.lang.RestFn.invoke (RestFn.java:397)
clojure.lang.Var.invoke (Var.java:375)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invokeStatic (core.clj:646)
clojure.main$main_opt.invokeStatic (main.clj:314)
clojure.main$main_opt.invoke (main.clj:310)
clojure.main$main.invokeStatic (main.clj:421)
clojure.main$main.doInvoke (main.clj:384)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: bookmark88 in this context
at clojure.lang.Util.runtimeException (Util.java:221)
clojure.lang.Compiler.resolveIn (Compiler.java:7164)
clojure.lang.Compiler.resolve (Compiler.java:7108)
clojure.lang.Compiler.analyzeSymbol (Compiler.java:7069)
clojure.lang.Compiler.analyze (Compiler.java:6648)
clojure.lang.Compiler.analyze (Compiler.java:6625)
clojure.lang.Compiler.eval (Compiler.java:6931)
clojure.lang.Compiler.load (Compiler.java:7379)
clojure.lang.Compiler.loadFile (Compiler.java:7317)
clojure.lang.RT$3.invoke (RT.java:320)
leiningen.core.project$read_raw$fn__6407.invoke (project.clj:960)
leiningen.core.project$read_raw.invokeStatic (project.clj:956)
leiningen.core.project$read_raw.invoke (project.clj:952)
leiningen.core.project$read.invokeStatic (project.clj:973)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.project$read.invokeStatic (project.clj:974)
leiningen.core.project$read.invoke (project.clj:970)
leiningen.core.main$_main$fn__5998.invoke (main.clj:397)
leiningen.core.main$_main.invokeStatic (main.clj:394)
leiningen.core.main$_main.doInvoke (main.clj:391)
clojure.lang.RestFn.invoke (RestFn.java:397)
clojure.lang.Var.invoke (Var.java:375)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invokeStatic (core.clj:646)
clojure.main$main_opt.invokeStatic (main.clj:314)
clojure.main$main_opt.invoke (main.clj:310)
clojure.main$main.invokeStatic (main.clj:421)
clojure.main$main.doInvoke (main.clj:384)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)"
I have a project in Clojure that I did several months ago that lein runs fine in and am up to date with current versions of lein and java.
Could someone please help?
When you run lein from a directory that is a lein project (has a project.clj file), it will try to parse the project file even though you did not give it any commands. If you run lein from a directory that is not a project, it will at least print out the commands available, as there's no project file to read.
There is an error "Unable to resolve symbol bookmark88" in the text above. This is in your project.clj file. Paste its contents to your original question if you need help, or examine it yourself to determine the problem. This is the reason you can't run lein.
I would recommend you put your project in its own directory, not on your desktop, as it seems you currently are. Then in your terminal change to the project directory (the one that contains project.clj) and run lein from there.
Related
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
I am trying to deploy a package to clojars.
When I run lein deploy clojars command, I get
following error
java.lang.IllegalArgumentException: Must provide valid :files to deploy-artifacts
at cemerick.pomegranate.aether$deploy_artifacts.invokeStatic (aether.clj:346)
cemerick.pomegranate.aether$deploy_artifacts.doInvoke (aether.clj:312)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cemerick.pomegranate.aether$deploy.invokeStatic (aether.clj:431)
cemerick.pomegranate.aether$deploy.doInvoke (aether.clj:395)
clojure.lang.RestFn.invoke (RestFn.java:1096)
leiningen.deploy$deploy.invokeStatic (deploy.clj:235)
leiningen.deploy$deploy.doInvoke (deploy.clj:172)
clojure.lang.RestFn.invoke (RestFn.java:470)
clojure.lang.AFn.applyToHelper (AFn.java:165)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$partial_task$fn__7330.doInvoke (main.clj:284)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$apply_task.invokeStatic (main.clj:334)
leiningen.core.main$apply_task.invoke (main.clj:320)
leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
leiningen.core.main$_main$fn__7419.invoke (main.clj:453)
leiningen.core.main$_main.invokeStatic (main.clj:442)
leiningen.core.main$_main.doInvoke (main.clj:439)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.main$main_opt.invokeStatic (main.clj:514)
clojure.main$main_opt.invoke (main.clj:510)
clojure.main$main.invokeStatic (main.clj:664)
clojure.main$main.doInvoke (main.clj:616)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:40)
Not sure whats the requirement around :files option.
Any help is appreciated.
Thanks
Update
Here is the link to the project https://github.com/ludbek/sql-compose
The issue has been fixed. Not sure what went wrong with lein. Instead of using lein I used mvn to deploy the package.
The blog post below was helpful.
https://oli.me.uk/clojure-projects-from-scratch/
I'm a Java developer taking first steps with Clojure. I have put together a simple project using Leiningen 2.8.1 and Clojure 1.9.0. The code of my project is available here.
My problem is very simple. When I run "lein" from the console I get this error:
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Named
at clojure.core$name.invokeStatic (core.clj:1546)
clojure.core$name.invoke (core.clj:1540)
leiningen.core.project$absolutize_path.invokeStatic (project.clj:453)
leiningen.core.project$absolutize_path.invoke (project.clj:452)
clojure.core.protocols$iter_reduce.invokeStatic (protocols.clj:49)
clojure.core.protocols$fn__6744.invokeStatic (protocols.clj:75)
clojure.core.protocols/fn (protocols.clj:75)
clojure.core.protocols$fn__6684$G__6679__6697.invoke (protocols.clj:13)
clojure.core$reduce.invokeStatic (core.clj:6545)
clojure.core$reduce.invoke (core.clj:6527)
leiningen.core.project$absolutize_paths.invokeStatic (project.clj:463)
leiningen.core.project$absolutize_paths.invoke (project.clj:462)
leiningen.core.project$init_profiles.invokeStatic (project.clj:887)
leiningen.core.project$init_profiles.doInvoke (project.clj:865)
clojure.lang.RestFn.invoke (RestFn.java:425)
leiningen.core.project$init_project.invokeStatic (project.clj:950)
leiningen.core.project$init_project.invoke (project.clj:942)
leiningen.core.project$read.invokeStatic (project.clj:1023)
leiningen.core.project$read.invoke (project.clj:1020)
leiningen.core.project$read.invokeStatic (project.clj:1024)
leiningen.core.project$read.invoke (project.clj:1020)
leiningen.core.main$_main$fn__4734.invoke (main.clj:416)
leiningen.core.main$_main.invokeStatic (main.clj:411)
leiningen.core.main$_main.doInvoke (main.clj:408)
clojure.lang.RestFn.invoke (RestFn.java:397)
clojure.lang.Var.invoke (Var.java:375)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invokeStatic (core.clj:646)
clojure.main$main_opt.invokeStatic (main.clj:314)
clojure.main$main_opt.invoke (main.clj:310)
clojure.main$main.invokeStatic (main.clj:421)
clojure.main$main.doInvoke (main.clj:384)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
It doesn't matter if I run lein or lein test, the result is the same. And I don't see any reference to my code in the stack trace, so I'm clueless.
Any ideas of what's wrong?
Thanks in advance.
Your project.clj file is missing a closing bracket here.
:dependencies [[org.clojure/clojure "1.8.0"]
[mount "0.1.11"] ;; delete extra bracket
[midje "1.9.1"]
[com.datomic/datomic-free "0.9.5656"]] ;; add closing bracket
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.
I've downloaded lein, put it in my /bin folder, and made it executable. I've also downloaded java:
$java -version
java version "1.7.0_65"
But I get the following error upon running the command:
$lein
java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry
at clojure.lang.APersistentMap$ValSeq.first (APersistentMap.java:185)
clojure.lang.RT.first (RT.java:577)
clojure.core$first.invoke (core.clj:55)
clojure.core$map$fn__4245.invoke (core.clj:2559)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.RT.seq (RT.java:484)
clojure.core$seq.invoke (core.clj:133)
clojure.core$zipmap.invoke (core.clj:2788)
leiningen.core.utils$map_vals.doInvoke (utils.clj:115)
clojure.lang.RestFn.invoke (RestFn.java:442)
leiningen.core.user/fn (user.clj:69)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$memoize$fn__5097.doInvoke (core.clj:5846)
clojure.lang.RestFn.invoke (RestFn.java:408)
leiningen.core.user/fn (user.clj:85)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$memoize$fn__5097.doInvoke (core.clj:5846)
clojure.lang.RestFn.invoke (RestFn.java:397)
leiningen.core.project$read_profiles.invoke (project.clj:622)
leiningen.core.project$project_with_profiles.invoke (project.clj:736)
leiningen.core.main$_main$fn__5979.invoke (main.clj:358)
leiningen.core.main$_main.doInvoke (main.clj:353)
clojure.lang.RestFn.invoke (RestFn.java:397)
clojure.lang.Var.invoke (Var.java:375)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invoke (core.clj:624)
clojure.main$main_opt.invoke (main.clj:315)
clojure.main$main.doInvoke (main.clj:420)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
I get this when I try to make my first project also:
$lein new compojure-app guestbook
java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.util.Map$Entry
at clojure.lang.APersistentMap$ValSeq.first (APersistentMap.java:185)
clojure.lang.RT.first (RT.java:577)
clojure.core$first.invoke (core.clj:55)
clojure.core$map$fn__4245.invoke (core.clj:2559)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.RT.seq (RT.java:484)
clojure.core$seq.invoke (core.clj:133)
clojure.core$zipmap.invoke (core.clj:2788)
leiningen.core.utils$map_vals.doInvoke (utils.clj:115)
clojure.lang.RestFn.invoke (RestFn.java:442)
leiningen.core.user/fn (user.clj:69)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$memoize$fn__5097.doInvoke (core.clj:5846)
clojure.lang.RestFn.invoke (RestFn.java:408)
leiningen.core.user/fn (user.clj:85)
clojure.lang.AFn.applyToHelper (AFn.java:152)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:624)
clojure.core$memoize$fn__5097.doInvoke (core.clj:5846)
clojure.lang.RestFn.invoke (RestFn.java:397)
leiningen.core.project$read_profiles.invoke (project.clj:622)
leiningen.core.project$project_with_profiles.invoke (project.clj:736)
leiningen.core.main$_main$fn__5979.invoke (main.clj:358)
leiningen.core.main$_main.doInvoke (main.clj:353)
clojure.lang.RestFn.invoke (RestFn.java:436)
clojure.lang.Var.invoke (Var.java:388)
clojure.lang.AFn.applyToHelper (AFn.java:160)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invoke (core.clj:624)
clojure.main$main_opt.invoke (main.clj:315)
clojure.main$main.doInvoke (main.clj:420)
clojure.lang.RestFn.invoke (RestFn.java:482)
clojure.lang.Var.invoke (Var.java:401)
clojure.lang.AFn.applyToHelper (AFn.java:171)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
What is the problem here? Thank you in advance.
As per Alex's comment, the problem was solved by replacing the malformed .lein/profiles.clj:
$nano .lein/profiles.clj
[lein-ancient "0.5.5"]
with a properly formed profile . I used this profile, found at gist.github.com/devn/4403577 :
{:user {:plugins [[lein-swank "1.4.5"]
;; [lein-pedantic "0.0.5"]
;; [lein-ritz "0.6.0"]
[lein-checkout-deps "1.0.0"]
;; [lein-haml-sass "0.2.4"]
[lein-midje "2.0.1"]
[lein-kibit "0.0.7"]]}
{:dependencies [[slamhound "1.3.0"]]}
{:aliases {"slamhound" ["run" "-m" "slam.hound"]}}}