Deploy clojure packages to clojar - clojure

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/

Related

Leiningen throws clojure.lang.PersistentVector cannot be cast to clojure.lang.Named

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

java.lang.StackOverflowError in clojure.java.data from-java

I have a Java class generated by Protocol Buffers called TextLine. When I instantiate the Java object with:
(def tb (-> (TextLine/newBuilder) (.setText "this is a text line") (.build)))
And then call:
(from-java tb)
I receive a StackOverflowError:
java.lang.StackOverflowError: null
at java.lang.Class.getMethods (Class.java:1614)
clojure.lang.Reflector.getMethods (Reflector.java:373)
clojure.lang.Reflector.invokeNoArgInstanceMember (Reflector.java:311)
clojure.java.data$add_getter_fn.invokeStatic (data.clj:38)
clojure.java.data$add_getter_fn.invoke (data.clj:37)
clojure.core.protocols$fn__6755.invokeStatic (protocols.clj:167)
clojure.core.protocols/fn (protocols.clj:124)
clojure.core.protocols$fn__6710$G__6705__6719.invoke (protocols.clj:19)
clojure.core.protocols$seq_reduce.invokeStatic (protocols.clj:31)
clojure.core.protocols$fn__6732.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)
clojure.java.data$eval554$fn__555.invoke (data.clj:135)
clojure.lang.MultiFn.invoke (MultiFn.java:229)
clojure.java.data$make_getter_fn$fn__501.invoke (data.clj:35)
clojure.java.data$eval554$fn__555$iter__556__560$fn__561.invoke (data.clj:136)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.next (RT.java:688)
clojure.core$next__4341.invokeStatic (core.clj:64)
clojure.core.protocols$fn__6755.invokeStatic (protocols.clj:168)
clojure.core.protocols/fn (protocols.clj:124)
clojure.core.protocols$fn__6710$G__6705__6719.invoke (protocols.clj:19)
clojure.core.protocols$seq_reduce.invokeStatic (protocols.clj:31)
clojure.core.protocols$fn__6738.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$into.invokeStatic (core.clj:6610)
clojure.core$into.invoke (core.clj:6604)
clojure.java.data$eval554$fn__555.invoke (data.clj:136)
clojure.lang.MultiFn.invoke (MultiFn.java:229)
clojure.java.data$make_getter_fn$fn__501.invoke (data.clj:35)
clojure.java.data$eval554$fn__555$iter__556__560$fn__561.invoke (data.clj:136)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.next (RT.java:688)
clojure.core$next__4341.invokeStatic (core.clj:64)
clojure.core.protocols$fn__6755.invokeStatic (protocols.clj:168)
clojure.core.protocols/fn (protocols.clj:124)
clojure.core.protocols$fn__6710$G__6705__6719.invoke (protocols.clj:19)
clojure.core.protocols$seq_reduce.invokeStatic (protocols.clj:31)
clojure.core.protocols$fn__6738.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$into.invokeStatic (core.clj:6610)
clojure.core$into.invoke (core.clj:6604)
clojure.java.data$eval554$fn__555.invoke (data.clj:136)
clojure.lang.MultiFn.invoke (MultiFn.java:229)
clojure.java.data$make_getter_fn$fn__501.invoke (data.clj:35)
clojure.java.data$eval554$fn__555$iter__556__560$fn__561.invoke (data.clj:136)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.next (RT.java:688)
clojure.core$next__4341.invokeStatic (core.clj:64)
clojure.core.protocols$fn__6755.invokeStatic (protocols.clj:168)
clojure.core.protocols/fn (protocols.clj:124)
clojure.core.protocols$fn__6710$G__6705__6719.invoke (protocols.clj:19)
....
Any ideas on what could be causing this or the best way to troubleshoot it? I'd really like to interface with the Java object as a Clojure map.
I wouldn't recommend using clojure.data.java/from-java for much of anything. The idea that simple function can translate an arbitrary Java object into a reasonable Clojure map without any domain knowledge of the source object is wishful thinking.
I hadn't heard of it before today, but I went and looked at the source and as expected it is basically just an extension of clojure.core/bean, another hopeful attempt at an impossible problem. Specifically, it uses javabean introspection to try to guess what getters and setters represent meaningful fields. Now, However, like many Java classes that weren't designed to be used as beans, protobuf classes contain circular references, which means that recursively bean-ing them up is an infinite task, leading eventually to a stack overflow.
What to do instead? I would recommend just working with the generated Java protobuf classes through Java interop, or perhaps trying to find a good Clojure protobuf library. Don't try to convert the Java objects into idiomatic Clojure data.

Leiningen is installed but I Get Error When Attempting to Run

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.

How to read clojure stack trace?

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.

cannot run lein script

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"]}}}