Likely something wrong with my updated build.boot file: https://github.com/laforge49/sente-boot/blob/master/build.boot
(Been on the backend too long!)
I've tried changing the version of clojure and clojurescript. Previously I was not finding class RT, so I've made some progress at least.
Here's my dependencies:
:dependencies '[
[org.clojure/clojure "1.9.0" :scope "provided"]
[org.clojure/core.async "0.4.490"]
[org.clojure/clojurescript "1.9.562"]
[adzerk/boot-reload "0.5.1" :scope "test"]
[adzerk/boot-cljs "2.0.0" :scope "test"]
[com.taoensso/sente "1.14.0-RC2"] ; <--- Sente
[com.taoensso/timbre "4.10.0"]
[http-kit "2.3.0"]
[ring "1.7.1"]
[ring/ring-defaults "0.3.2"] ; Includes `ring-anti-forgery`, etc.
[compojure "1.6.1"] ; Or routing lib of your choice
[hiccup "1.0.5"] ; Optional, just for HTML
[com.cognitect/transit-clj "0.8.313"]
[com.cognitect/transit-cljs "0.8.256"]
[onetom/boot-lein-generate "0.1.3"]]
I get this error:
clojure.lang.ExceptionInfo: clojure/lang/IFn
data: {:file "org\\httpkit\\server.clj", :line 66}
java.lang.NoClassDefFoundError: clojure/lang/IFn
java.lang.ClassNotFoundException: clojure.lang.IFn
...
clojure.core/load/fn core.clj: 6007
clojure.core/load/invokeStatic core.clj: 6006
clojure.core/load core.clj: 5990
...
I am trying to connect to Repl in Clojure project in Light Table. I went to connections, chose project.clj I wanted to connect to but unfortunately without success. I created project with "lein new app my-app". Before this, I had tried to connect with some another project that I had created with Luminus template and it was successfully. But when I made this simple app with "lein new app my-app" I cant connect. I got the following error:
We couldn't connect.
Looks like there was an issue trying to connect to the project. Here's what we got:
final project: {:description FIXME: write description, :compile-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev+8ddc75d4\classes, :deploy-repositories [[clojars {:url https://clojars.org/repo/, :password :gpg, :username :gpg}]], :group my-first-neural-network, :license {:name EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0, :url https://www.eclipse.org/legal/epl-2.0/}, :java-cmd C:\Program Files\Java\jdk1.8.0_201\bin\java.exe, :resource-paths (C:\Users\nenad\Desktop\my-first-neural-network\dev-resources C:\Users\nenad\Desktop\my-first-neural-network\resources), :uberjar-merge-with {META-INF/plexus/components.xml leiningen.uberjar/components-merger, data_readers.clj leiningen.uberjar/clj-map-merger, #"META-INF/services/.*" [clojure.core/slurp (fn* [p1__953__955__auto__ p2__954__956__auto__] (clojure.core/str p1__953__955__auto__
p2__954__956__auto__)) clojure.core/spit]}, :name my-first-neural-network, :checkout-deps-shares [:source-paths :test-paths :resource-paths :compile-path #'leiningen.core.classpath/checkout-deps-paths], :source-paths (C:\Users\nenad\Desktop\my-first-neural-network\src), :eval-in :subprocess, :repositories [[central {:url https://repo1.maven.org/maven2/, :snapshots false}] [clojars {:url https://clojars.org/repo/}]], :test-paths (C:\Users\nenad\Desktop\my-first-neural-network\test), :target-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev+8ddc75d4, :prep-tasks [javac compile], :native-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev+8ddc75d4\native, :offline? false, :root C:\Users\nenad\Desktop\my-first-neural-network, :pedantic? ranges, :clean-targets [:target-path], :plugins [], :url http://example.com/FIXME, :profiles {:uberjar {:aot [:all], :jvm-opts nil, :eval-in nil}}, :plugin-repositories [[central {:url https://repo1.maven.org/maven2/, :snapshots false}] [clojars {:url https://clojars.org/repo/}]], :version 0.1.0-SNAPSHOT, :jar-exclusions [#"^\."], :main my-first-neural-network.core, :global-vars {}, :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$"], :jvm-opts [], :dependencies ([org.clojure/clojure 1.10.0] [org.clojure/tools.nrepl 0.2.10 :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete 0.2.3 :exclusions ([org.clojure/clojure])] [lein-light-nrepl/lein-light-nrepl 0.3.3] [lein-light-nrepl-instarepl/lein-light-nrepl-instarepl 0.3.1]), :release-tasks [[vcs assert-committed] [change version leiningen.release/bump-version release] [vcs commit] [vcs tag] [deploy] [change version leiningen.release/bump-version] [vcs commit] [vcs push]], :repl-options {:nrepl-middleware [lighttable.nrepl.handler/lighttable-ops], :init (clojure.core/swap! lighttable.nrepl.core/my-settings clojure.core/merge {:name my-first-neural-network 0.1.0-SNAPSHOT, :project (quote {:description FIXME: write description, :compile-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev\classes, :deploy-repositories [[clojars {:url https://clojars.org/repo/, :password :gpg, :username :gpg}]], :group my-first-neural-network, :license {:name EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0, :url https://www.eclipse.org/legal/epl-2.0/}, :java-cmd C:\Program Files\Java\jdk1.8.0_201\bin\java.exe, :resource-paths (C:\Users\nenad\Desktop\my-first-neural-network\dev-resources C:\Users\nenad\Desktop\my-first-neural-network\resources), :uberjar-merge-with {META-INF/plexus/components.xml leiningen.uberjar/components-merger, data_readers.clj leiningen.uberjar/clj-map-merger, #"META-INF/services/.*" [clojure.core/slurp (fn* [p1__953__955__auto__ p2__954__956__auto__] (clojure.core/str p1__953__955__auto__
p2__954__956__auto__)) clojure.core/spit]}, :name my-first-neural-network, :checkout-deps-shares [:source-paths :test-paths :resource-paths :compile-path #'leiningen.core.classpath/checkout-deps-paths], :source-paths (C:\Users\nenad\Desktop\my-first-neural-network\src), :eval-in :subprocess, :repositories [[central {:url https://repo1.maven.org/maven2/, :snapshots false}] [clojars {:url https://clojars.org/repo/}]], :test-paths (C:\Users\nenad\Desktop\my-first-neural-network\test), :target-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev, :prep-tasks [javac compile], :native-path C:\Users\nenad\Desktop\my-first-neural-network\target\base+system+user+dev\native, :offline? false, :root C:\Users\nenad\Desktop\my-first-neural-network, :pedantic? ranges, :clean-targets [:target-path], :plugins [], :url http://example.com/FIXME, :profiles {:uberjar {:aot [:all], :jvm-opts nil, :eval-in nil}}, :plugin-repositories [[central {:url https://repo1.maven.org/maven2/, :snapshots false}] [clojars {:url https://clojars.org/repo/}]], :version 0.1.0-SNAPSHOT, :jar-exclusions [#"^\."], :main my-first-neural-network.core, :global-vars {}, :uberjar-exclusions [#"(?i)^META-INF/[^/]*\.(SF|RSA|DSA)$"], :jvm-opts [], :dependencies ([org.clojure/clojure 1.10.0] [org.clojure/tools.nrepl 0.2.10 :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete 0.2.3 :exclusions ([org.clojure/clojure])]), :release-tasks [[vcs assert-committed] [change version leiningen.release/bump-version release] [vcs commit] [vcs tag] [deploy] [change version leiningen.release/bump-version] [vcs commit] [vcs push]], :test-selectors {:default (constantly true)}})})}, :test-selectors {:default (constantly true)}}
Error loading lighttable.nrepl.handler: Syntax error macroexpanding clojure.core/ns at (cljs/source_map/base64_vlq.clj:1:1).
Exception in thread "main" Syntax error compiling var at (C:\Users\nenad\AppData\Local\Temp\form-init2299474071958135132.clj:1:5184).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
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.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 34 more
clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 1}
at clojure.core$ex_info.invoke(core.clj:4593)
at leiningen.core.eval$fn__2432.invoke(eval.clj:236)
at clojure.lang.MultiFn.invoke(MultiFn.java:233)
at leiningen.core.eval$eval_in_project.invoke(eval.clj:337)
at clojure.lang.AFn.applyToHelper(AFn.java:160)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:632)
at leiningen.repl$repl.doInvoke(repl.clj:322)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.light_nrepl$light.invoke(light_nrepl.clj:77)
at leiningen.light_nrepl$_main.doInvoke(light_nrepl.clj:85)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at leiningen.light_nrepl.main(Unknown Source)
close
I changed Clojure version in project.clj file in root of the project but now I cant start REPL. I got the follwing error:
Starting nREPL server...
"C:\Program Files\Java\jdk-11.0.2\bin\java.exe" -Dfile.encoding=Cp1252 -Dconf=dev-config.edn -Dclojure.compile.path=C:\Users\nenad\Desktop\Vezba\myapp\target\default\classes -Dmyapp.version=0.1.0-SNAPSHOT -Dclojure.debug=false "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5\lib\idea_rt.jar=49713:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5\bin" -classpath C:\Users\nenad\Desktop\Vezba\myapp\test\clj;C:\Users\nenad\Desktop\Vezba\myapp\env\dev\clj;C:\Users\nenad\Desktop\Vezba\myapp\src\clj;C:\Users\nenad\Desktop\Vezba\myapp\env\dev\resources;C:\Users\nenad\Desktop\Vezba\myapp\dev-resources;C:\Users\nenad\Desktop\Vezba\myapp\resources;C:\Users\nenad\Desktop\Vezba\myapp\target\default\classes;C:\Users\nenad\.m2\repository\metosin\reitit-core\0.3.1\reitit-core-0.3.1.jar;C:\Users\nenad\.m2\repository\ring\ring-core\1.7.1\ring-core-1.7.1.jar;C:\Users\nenad\.m2\repository\funcool\cuerdas\2.0.5\cuerdas-2.0.5.jar;C:\Users\nenad\.m2\repository\clojure-complete\clojure-complete\0.2.5\clojure-complete-0.2.5.jar;C:\Users\nenad\.m2\repository\org\clojure\clojure\1.8.0\clojure-1.8.0.jar;C:\Users\nenad\.m2\repository\cprop\cprop\0.1.13\cprop-0.1.13.jar;C:\Users\nenad\.m2\repository\org\msgpack\msgpack\0.6.12\msgpack-0.6.12.jar;C:\Users\nenad\.m2\repository\org\webjars\webjars-locator\0.36\webjars-locator-0.36.jar;C:\Users\nenad\.m2\repository\expound\expound\0.7.2\expound-0.7.2.jar;C:\Users\nenad\.m2\repository\lambdaisland\deep-diff\0.0-25\deep-diff-0.0-25.jar;C:\Users\nenad\.m2\repository\tigris\tigris\0.1.1\tigris-0.1.1.jar;C:\Users\nenad\.m2\repository\mvxcvi\arrangement\1.1.1\arrangement-1.1.1.jar;C:\Users\nenad\.m2\repository\org\projectodd\wunderboss\wunderboss-web\0.13.1\wunderboss-web-0.13.1.jar;C:\Users\nenad\.m2\repository\metosin\reitit-dev\0.3.1\reitit-dev-0.3.1.jar;C:\Users\nenad\.m2\repository\ch\qos\logback\logback-classic\1.1.3\logback-classic-1.1.3.jar;C:\Users\nenad\.m2\repository\metosin\reitit-swagger\0.3.1\reitit-swagger-0.3.1.jar;C:\Users\nenad\.m2\repository\selmer\selmer\1.12.12\selmer-1.12.12.jar;C:\Users\nenad\.m2\repository\metosin\reitit-schema\0.3.1\reitit-schema-0.3.1.jar;C:\Users\nenad\.m2\repository\com\cognitect\transit-clj\0.8.313\transit-clj-0.8.313.jar;C:\Users\nenad\.m2\repository\org\projectodd\wunderboss\wunderboss-core\0.13.1\wunderboss-core-0.13.1.jar;C:\Users\nenad\.m2\repository\org\clojure\core.rrb-vector\0.0.13\core.rrb-vector-0.0.13.jar;C:\Users\nenad\.m2\repository\meta-merge\meta-merge\1.0.0\meta-merge-1.0.0.jar;C:\Users\nenad\.m2\repository\joda-time\joda-time\2.9.9\joda-time-2.9.9.jar;C:\Users\nenad\.m2\repository\ring\ring-headers\0.3.0\ring-headers-0.3.0.jar;C:\Users\nenad\.m2\repository\pjstadig\humane-test-output\0.9.0\humane-test-output-0.9.0.jar;C:\Users\nenad\.m2\repository\javax\xml\bind\jaxb-api\2.3.0\jaxb-api-2.3.0.jar;C:\Users\nenad\.m2\repository\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;C:\Users\nenad\.m2\repository\mount\mount\0.1.16\mount-0.1.16.jar;C:\Users\nenad\.m2\repository\ring\ring-ssl\0.3.0\ring-ssl-0.3.0.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.7\jackson-datatype-jsr310-2.9.7.jar;C:\Users\nenad\.m2\repository\org\projectodd\wunderboss\wunderboss-web-undertow\0.13.1\wunderboss-web-undertow-0.13.1.jar;C:\Users\nenad\.m2\repository\metosin\reitit\0.3.1\reitit-0.3.1.jar;C:\Users\nenad\.m2\repository\metosin\reitit-spec\0.3.1\reitit-spec-0.3.1.jar;C:\Users\nenad\.m2\repository\commons-fileupload\commons-fileupload\1.3.3\commons-fileupload-1.3.3.jar;C:\Users\nenad\.m2\repository\io\undertow\undertow-core\1.4.14.Final\undertow-core-1.4.14.Final.jar;C:\Users\nenad\.m2\repository\metosin\reitit-middleware\0.3.1\reitit-middleware-0.3.1.jar;C:\Users\nenad\.m2\repository\prone\prone\1.6.1\prone-1.6.1.jar;C:\Users\nenad\.m2\repository\metosin\jsonista\0.2.2\jsonista-0.2.2.jar;C:\Users\nenad\.m2\repository\org\jboss\spec\javax\servlet\jboss-servlet-api_3.1_spec\1.0.0.Final\jboss-servlet-api_3.1_spec-1.0.0.Final.jar;C:\Users\nenad\.m2\repository\net\jodah\expiringmap\0.5.8\expiringmap-0.5.8.jar;C:\Users\nenad\.m2\repository\org\immutant\web\2.1.10\web-2.1.10.jar;C:\Users\nenad\.m2\repository\ring\ring-mock\0.3.2\ring-mock-0.3.2.jar;C:\Users\nenad\.m2\repository\prismatic\schema\1.1.9\schema-1.1.9.jar;C:\Users\nenad\.m2\repository\metosin\spec-tools\0.9.0\spec-tools-0.9.0.jar;C:\Users\nenad\.m2\repository\org\webjars\npm\material-icons\0.3.0\material-icons-0.3.0.jar;C:\Users\nenad\.m2\repository\org\clojure\tools.reader\0.10.0\tools.reader-0.10.0.jar;C:\Users\nenad\.m2\repository\org\ow2\asm\asm\5.1\asm-5.1.jar;C:\Users\nenad\.m2\repository\ring\ring-codec\1.1.1\ring-codec-1.1.1.jar;C:\Users\nenad\.m2\repository\nrepl\nrepl\0.6.0\nrepl-0.6.0.jar;C:\Users\nenad\.m2\repository\org\jboss\spec\javax\websocket\jboss-websocket-api_1.1_spec\1.1.0.Final\jboss-websocket-api_1.1_spec-1.1.0.Final.jar;C:\Users\nenad\.m2\repository\io\undertow\undertow-websockets-jsr\1.4.14.Final\undertow-websockets-jsr-1.4.14.Final.jar;C:\Users\nenad\.m2\repository\ns-tracker\ns-tracker\0.3.1\ns-tracker-0.3.1.jar;C:\Users\nenad\.m2\repository\org\clojure\java.classpath\0.2.3\java.classpath-0.2.3.jar;C:\Users\nenad\.m2\repository\org\webjars\webjars-locator-jboss-vfs\0.1.0\webjars-locator-jboss-vfs-0.1.0.jar;C:\Users\nenad\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar;C:\Users\nenad\.m2\repository\metosin\reitit-ring\0.3.1\reitit-ring-0.3.1.jar;C:\Users\nenad\.m2\repository\crypto-equality\crypto-equality\1.0.0\crypto-equality-1.0.0.jar;C:\Users\nenad\.m2\repository\tech\droit\clj-diff\1.0.0\clj-diff-1.0.0.jar;C:\Users\nenad\.m2\repository\org\jboss\xnio\xnio-api\3.3.6.Final\xnio-api-3.3.6.Final.jar;C:\Users\nenad\.m2\repository\org\projectodd\wunderboss\wunderboss-clojure\0.13.1\wunderboss-clojure-0.13.1.jar;C:\Users\nenad\.m2\repository\luminus-transit\luminus-transit\0.1.1\luminus-transit-0.1.1.jar;C:\Users\nenad\.m2\repository\org\jboss\xnio\xnio-nio\3.3.6.Final\xnio-nio-3.3.6.Final.jar;C:\Users\nenad\.m2\repository\metosin\reitit-sieppari\0.3.1\reitit-sieppari-0.3.1.jar;C:\Users\nenad\.m2\repository\com\cognitect\transit-js\0.8.846\transit-js-0.8.846.jar;C:\Users\nenad\.m2\repository\org\webjars\npm\bulma\0.7.4\bulma-0.7.4.jar;C:\Users\nenad\.m2\repository\metosin\ring-swagger-ui\2.2.10\ring-swagger-ui-2.2.10.jar;C:\Users\nenad\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\nenad\.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\nenad\.m2\repository\hiccup\hiccup\1.0.5\hiccup-1.0.5.jar;C:\Users\nenad\.m2\repository\org\webjars\webjars-locator-core\0.37\webjars-locator-core-0.37.jar;C:\Users\nenad\.m2\repository\clj-tuple\clj-tuple\0.2.2\clj-tuple-0.2.2.jar;C:\Users\nenad\.m2\repository\mvxcvi\puget\1.0.3\puget-1.0.3.jar;C:\Users\nenad\.m2\repository\clj-time\clj-time\0.14.3\clj-time-0.14.3.jar;C:\Users\nenad\.m2\repository\json-html\json-html\0.4.4\json-html-0.4.4.jar;C:\Users\nenad\.m2\repository\org\clojure\tools.logging\0.4.1\tools.logging-0.4.1.jar;C:\Users\nenad\.m2\repository\metosin\reitit-swagger-ui\0.3.1\reitit-swagger-ui-0.3.1.jar;C:\Users\nenad\.m2\repository\org\jboss\spec\javax\annotation\jboss-annotations-api_1.2_spec\1.0.0.Final\jboss-annotations-api_1.2_spec-1.0.0.Final.jar;C:\Users\nenad\.m2\repository\ring\ring-devel\1.7.1\ring-devel-1.7.1.jar;C:\Users\nenad\.m2\repository\luminus-immutant\luminus-immutant\0.2.5\luminus-immutant-0.2.5.jar;C:\Users\nenad\.m2\repository\org\clojure\tools.cli\0.4.2\tools.cli-0.4.2.jar;C:\Users\nenad\.m2\repository\org\clojure\tools.namespace\0.2.11\tools.namespace-0.2.11.jar;C:\Users\nenad\.m2\repository\metosin\ring-http-response\0.9.1\ring-http-response-0.9.1.jar;C:\Users\nenad\.m2\repository\potemkin\potemkin\0.4.5\potemkin-0.4.5.jar;C:\Users\nenad\.m2\repository\expiring-map\expiring-map\0.1.8\expiring-map-0.1.8.jar;C:\Users\nenad\.m2\repository\com\cognitect\transit-java\0.8.337\transit-java-0.8.337.jar;C:\Users\nenad\.m2\repository\metosin\reitit-interceptors\0.3.1\reitit-interceptors-0.3.1.jar;C:\Users\nenad\.m2\repository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar;C:\Users\nenad\.m2\repository\virgil\virgil\0.1.6\virgil-0.1.6.jar;C:\Users\nenad\.m2\repository\metosin\schema-tools\0.11.0\schema-tools-0.11.0.jar;C:\Users\nenad\.m2\repository\ring-webjars\ring-webjars\0.2.0\ring-webjars-0.2.0.jar;C:\Users\nenad\.m2\repository\luminus\ring-ttl-session\0.3.2\ring-ttl-session-0.3.2.jar;C:\Users\nenad\.m2\repository\metosin\muuntaja\0.6.4\muuntaja-0.6.4.jar;C:\Users\nenad\.m2\repository\crypto-random\crypto-random\1.2.0\crypto-random-1.2.0.jar;C:\Users\nenad\.m2\repository\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\Users\nenad\.m2\repository\riddley\riddley\0.1.12\riddley-0.1.12.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;C:\Users\nenad\.m2\repository\metosin\sieppari\0.0.0-alpha7\sieppari-0.0.0-alpha7.jar;C:\Users\nenad\.m2\repository\com\cognitect\transit-cljs\0.8.256\transit-cljs-0.8.256.jar;C:\Users\nenad\.m2\repository\fipp\fipp\0.6.17\fipp-0.6.17.jar;C:\Users\nenad\.m2\repository\markdown-clj\markdown-clj\1.0.7\markdown-clj-1.0.7.jar;C:\Users\nenad\.m2\repository\org\immutant\core\2.1.10\core-2.1.10.jar;C:\Users\nenad\.m2\repository\cheshire\cheshire\5.8.1\cheshire-5.8.1.jar;C:\Users\nenad\.m2\repository\io\undertow\undertow-servlet\1.4.14.Final\undertow-servlet-1.4.14.Final.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.9.6\jackson-dataformat-cbor-2.9.6.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\nenad\.m2\repository\metosin\reitit-frontend\0.3.1\reitit-frontend-0.3.1.jar;C:\Users\nenad\.m2\repository\ch\qos\logback\logback-core\1.1.3\logback-core-1.1.3.jar;C:\Users\nenad\.m2\repository\com\andrewmcveigh\cljs-time\0.5.2\cljs-time-0.5.2.jar;C:\Users\nenad\.m2\repository\org\jboss\logging\jboss-logging\3.2.1.Final\jboss-logging-3.2.1.Final.jar;C:\Users\nenad\.m2\repository\ring\ring-anti-forgery\1.3.0\ring-anti-forgery-1.3.0.jar;C:\Users\nenad\.m2\repository\realize\realize\1.1.0\realize-1.1.0.jar;C:\Users\nenad\.m2\repository\org\apache\commons\commons-compress\1.18\commons-compress-1.18.jar;C:\Users\nenad\.m2\repository\org\javassist\javassist\3.18.1-GA\javassist-3.18.1-GA.jar;C:\Users\nenad\.m2\repository\funcool\struct\1.3.0\struct-1.3.0.jar;C:\Users\nenad\.m2\repository\metosin\reitit-http\0.3.1\reitit-http-0.3.1.jar;C:\Users\nenad\.m2\repository\clojure\java-time\clojure.java-time\0.3.2\clojure.java-time-0.3.2.jar;C:\Users\nenad\.m2\repository\ring\ring-defaults\0.3.2\ring-defaults-0.3.2.jar;C:\Users\nenad\.m2\repository\org\clojure\spec.alpha\0.2.176\spec.alpha-0.2.176.jar;C:\Users\nenad\.m2\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.9.6\jackson-dataformat-smile-2.9.6.jar;C:\Users\nenad\.m2\repository\clj-stacktrace\clj-stacktrace\0.2.8\clj-stacktrace-0.2.8.jar clojure.main -i C:\Users\nenad\AppData\Local\Temp\form-init47301827214867056.clj
java.lang.ExceptionInInitializerError
at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.ExceptionInInitializerError, compiling:(user.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:359)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:355)
at clojure.lang.RT.doInit(RT.java:475)
at clojure.lang.RT.<clinit>(RT.java:331)
... 1 more
Caused by: java.lang.ExceptionInInitializerError
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.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
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:482)
at user$eval3$loading__5569__auto____4.invoke(user.clj:1)
at user$eval3.invokeStatic(user.clj:1)
at user$eval3.invoke(user.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)
... 6 more
Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/ident?
at clojure.lang.Var$Unbound.throwArity(Var.java:43)
at clojure.lang.AFn.invoke(AFn.java:32)
at clojure.spec.alpha$spec_impl.invokeStatic(alpha.clj:915)
at clojure.spec.alpha$spec_impl.invoke(alpha.clj:908)
at clojure.spec.alpha__init.load(Unknown Source)
at clojure.spec.alpha__init.<clinit>(Unknown Source)
... 37 more
Exception in thread "main"
Process finished with exit code 1
Exception starting REPL: java.lang.InterruptedException
Hmmm. The problem here is, LT doesn't support a Clojure project running Clojure >1.8.0. Yes, LT needs to update to support new Clojure/Script versions. There are WIP patches to help make this possible. For now, sadly, you'll have to drop down to older releases of Clojure.
I am building a server program to provide an API to a mongo database containing details of photos. All works well running it from the REPL, or if I start it using lein run.
The problems happen when I try and run the uberjar. Building the uberjar works ok:
(master) photo-api: lein uberjar
Compiling photo-api.env
Compiling photo-api.config
Compiling photo-api.core
WARNING: find-keyword already refers to: #'clojure.core/find-keyword in namespace: image-lib.core, being replaced by: #'image-lib.core/find-keyword
Compiling photo-api.db.core
Compiling photo-api.handler
Compiling photo-api.layout
Compiling photo-api.middleware
Compiling photo-api.routes.home
Compiling photo-api.routes.services
Created /Users/iain/Code/Clojure/Luminus/photo-api/target/uberjar/photo-api-0.1.0-SNAPSHOT.jar
Created /Users/iain/Code/Clojure/Luminus/photo-api/target/uberjar/photo-api.jar
(master) photo-api:
but running the jar gives an error:
(master) photo-api: java -jar target/uberjar/photo-api.jar
WARNING: find-keyword already refers to: #'clojure.core/find-keyword in namespace: image-lib.core, being replaced by: #'image-lib.core/find-keyword
read config from resource: "config.edn"
Exception in thread "main" java.lang.RuntimeException: could not start [#'photo-api.db.core/db*] due to
at mount.core$up$fn__420.invoke(core.cljc:92)
at mount.core$up.invokeStatic(core.cljc:92)
at mount.core$up.invoke(core.cljc:90)
at mount.core$bring.invokeStatic(core.cljc:210)
at mount.core$bring.invoke(core.cljc:202)
at mount.core$start.invokeStatic(core.cljc:252)
at mount.core$start.doInvoke(core.cljc:244)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at mount.core$start_with_args.invokeStatic(core.cljc:350)
at mount.core$start_with_args.doInvoke(core.cljc:346)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at photo_api.core$start_app.invokeStatic(core.clj:42)
at photo_api.core$start_app.invoke(core.clj:41)
at photo_api.core$_main.invokeStatic(core.clj:50)
at photo_api.core$_main.doInvoke(core.clj:49)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at photo_api.core.main(Unknown Source)
Caused by: java.lang.NullPointerException
at com.mongodb.ConnectionString.<init>(ConnectionString.java:222)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:189)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:171)
at monger.core$connect_via_uri.invokeStatic(core.clj:230)
at monger.core$connect_via_uri.invoke(core.clj:230)
at photo_api.db.core$fn__12620.invokeStatic(core.clj:29)
at photo_api.db.core$fn__12620.invoke(core.clj:28)
at mount.core$record_BANG_.invokeStatic(core.cljc:86)
at mount.core$record_BANG_.invoke(core.cljc:85)
at mount.core$up$fn__420.invoke(core.cljc:93)
... 18 more
Or the SNAPSHOT jar.
(master) photo-api: java -jar target/uberjar/photo-api-0.1.0-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Var
at photo_api.core.<clinit>(Unknown Source)
Caused by: java.lang.ClassNotFoundException: clojure.lang.Var
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
(master) photo-api:
What am I missing here? I'm guessing it's something to do with dev build and production build differences, but I can't spot anything obvious and the error messages are not a lot of help to me.
This is the project file which as far as I remember is mostly straight from the original luminus template:
(defproject photo-api "0.1.0-SNAPSHOT"
:description "API for geting data from photos db"
:url "http://soulflyer.com"
:dependencies [[cider/cider-nrepl "0.14.0"]
[clj-time "0.13.0"]
[com.google.guava/guava "20.0"]
[com.novemberain/monger "3.1.0" :exclusions [com.google.guava/guava]]
[compojure "1.6.0"]
[cprop "0.1.10"]
[funcool/struct "1.0.0"]
[luminus-immutant "0.2.3"]
[luminus-nrepl "0.1.4"]
[luminus/ring-ttl-session "0.3.2"]
[markdown-clj "0.9.99"]
[metosin/compojure-api "1.1.10"]
[metosin/muuntaja "0.3.1"]
[metosin/ring-http-response "0.9.0"]
[mount "0.1.11"]
[org.clojure/clojure "1.8.0"]
[org.clojure/tools.cli "0.3.5"]
[org.clojure/tools.logging "0.4.0"]
[org.clojure/data.json "0.2.6"]
[org.webjars.bower/tether "1.4.0"]
[org.webjars/bootstrap "4.0.0-alpha.5"]
[org.webjars/font-awesome "4.7.0"]
[org.webjars/jquery "3.1.1"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.6.1"]
[ring/ring-defaults "0.3.0"]
[selmer "1.10.7"]
[image-lib "0.2.1-SNAPSHOT"]]
:min-lein-version "2.0.0"
:jvm-opts ["-server" "-Dconf=.lein-env"]
:source-paths ["src/clj"]
:test-paths ["test/clj"]
:resource-paths ["resources"]
:target-path "target/%s/"
:main ^:skip-aot photo-api.core
:plugins [[lein-cprop "1.0.3"]
[org.clojars.punkisdead/lein-cucumber "1.0.5"]
[lein-immutant "2.1.0"]]
:cucumber-feature-paths ["test/clj/features"]
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "photo-api.jar"
:source-paths ["env/prod/clj"]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:dependencies [[prone "1.1.4"]
[ring/ring-mock "0.3.0"]
[ring/ring-devel "1.6.1"]
[pjstadig/humane-test-output "0.8.2"]
[clj-webdriver/clj-webdriver "0.7.2"]
[org.apache.httpcomponents/httpcore "4.4"]
[org.clojure/core.cache "0.6.3"]
[org.seleniumhq.selenium/selenium-server "2.48.2"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.19.0"]
[refactor-nrepl "2.3.0-SNAPSHOT"]]
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:resource-paths ["env/test/resources"]}
:profiles/dev {}
:profiles/test {}})
I think you're just missing required configuration - at least Mongo connection string.
When running in dev mode, the luminus (and cprops configuration library) uses the config from your profiles.clj.
However, this is the leiningen thing and it's not available when running from uberjar.
You can specify all your "production" configuration in "config.edn" file and run uberjar like this:
java -Dconf=config.edn -jar target/uberjar/photo-api.jar
You can also use java system properties to set configuration values one by one.
See http://www.luminusweb.net/docs/environment.md for more details.
if I use lein run the project is no problem.
But when I use jave -jar blog.jar after lein uberjar It happen exceptions.
16-Jul-20 11:28:05 DESKTOP-C3SC9AR INFO [slf4j-timbre.adapter] - >> starting.. *db*
Exception in thread "main" java.lang.RuntimeException: could not start [*db*] due to
.....
Caused by: java.lang.Exception: :jdbc-url, :datasource, or :datasource-
AND my project.clj file
(defproject blog "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies ....
:min-lein-version "2.0.0"
:uberjar-name "blog.jar"
:jvm-opts ["-server"]
:main blog.core
:migratus {:store :database}
:plugins [[lein-environ "1.0.1"]
[migratus-lein "0.2.0"]]
:profiles
{:uberjar {:omit-source true
:env {:production true}
:aot :all
:source-paths ["env/prod/clj"]}
:dev [:project/dev :profiles/dev]
:test [:project/test :profiles/test]
:project/dev ...
:project/test ...
:profiles/dev {:env {:database-url "jdbc:postgresql://localhost/blog?user=postgres&password=root"}}
:profiles/test {}})
Maybe it can't find the key of "database-url"?
Data provided via environment settings in project.clj are not provided when you use java directly. It's your responsibility to make sure the environment settings visible to the app provide any credentials or connection info needed.
It could look something like:
DATABASE_URL="jdbc...." java -jar my-project-standalone.jar
I am deploying a Clojure project built on luminus on Ubuntu server. When I try to start my server I get the following exception:
Exception Directory does not exist: resources ring.middleware.file/ensure-dir (file.clj:12)
This is my project.clj file
(defproject big5 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[lib-noir "0.5.0"]
[compojure "1.1.5" :exclusions [ring/ring-core]]
[com.cemerick/friend "0.1.5"]
[ring-server "0.2.7"]
[clabango "0.5"]
[korma "0.3.0-RC6"]
[mysql/mysql-connector-java "5.1.6"]
[com.taoensso/timbre "2.7.1"]
[com.taoensso/tower "2.0.1"]
[com.postspectacular/rotor "0.1.0"]
[markdown-clj "0.9.19"]
[clj-json "0.5.3"]
[clj-time "0.6.0"]
[log4j "1.2.17"
:exclusions
[javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]
[org.slf4j/slf4j-log4j12 "1.7.5"]]
:plugins [[lein2-eclipse "2.0.0"]
[lein-ring "0.8.7"]
[lein-midje "3.0.0"]]
:ring {:handler big5.handler/war-handler
:init big5.handler/init
:destroy big5.handler/destroy}
:profiles
{:production {:ring {:open-browser? false
:stacktraces? false
:auto-reload? false}}
:dev {:dependencies [[ring-mock "0.1.3"]
[ring/ring-devel "1.1.8"]
[midje "1.5.1"]]}}
:min-lein-version "2.0.0")
I believe Leiningen uses the resources directory as the classpath root. Typically resources/public is where you store your static web assets like images, javascript, and stylesheets. If you create those directories you should be good.
Here are some references for you:
Resources in Clojure applications
Serving static files with ring/compojure - from a war
Finally, from the luminus documentation itself:
http://www.luminusweb.net/docs#anatomy_of_a_luminus_application