This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-12
Channels
- # aleph (8)
- # announcements (9)
- # babashka (15)
- # beginners (91)
- # calva (54)
- # chlorine-clover (3)
- # cider (25)
- # clj-kondo (9)
- # cljfx (4)
- # cljsrn (12)
- # clojure (40)
- # clojure-australia (2)
- # clojure-europe (77)
- # clojure-nl (10)
- # clojure-spec (22)
- # clojure-uk (9)
- # clojurescript (39)
- # conjure (12)
- # cursive (8)
- # datascript (17)
- # datomic (22)
- # emacs (2)
- # expound (6)
- # fulcro (25)
- # kaocha (7)
- # malli (9)
- # meander (5)
- # off-topic (13)
- # pathom (8)
- # pedestal (5)
- # portal (1)
- # rdf (58)
- # re-frame (65)
- # reagent (15)
- # sci (3)
- # shadow-cljs (50)
- # test-check (6)
- # testing (3)
- # tools-deps (1)
- # vim (7)
- # xtdb (10)
Hi, I’m trying to deploy a brand new repository using the Luminus template on Heroku. But I get errors on the live app Logs from Heroku
2020-10-12T02:12:41.936928+00:00 app[web.1]: "Execution error (FileNotFoundException) at clojure.main/main (main.java:40).\nCould not locate <my_repo_name>/core__init.class, <my_repo_name>/core.clj or <my_repo_name>/core.cljc on classpath.\n",
project.clj:
....
{:uberjar {:omit-source true
:prep-tasks ["compile" ["shadow" "release" "app"]]
:aot :all
:uberjar-name "<my_repo_name>.jar"
:source-paths ["env/prod/clj" "env/prod/cljs" ]
:resource-paths ["env/prod/resources"]}
....
Also I got an error while it was running lein uberjar
during deployment, not sure if relevant
Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method, or the namespace has not been AOT-compiled.
Looks like your core.clj namespace isn't really there - are you sure you got the path/name correct?
I’m still new to Clojure, so I’m not sure.
When I run lein run
, the app works correctly.
I tried to run heroku run bash
, then lein classpath
output a big path string.
I also tried this
~ $ clj -Spath | sed -e 's/:/\'$'\n/g' | head
src
/app/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar
/app/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
/app/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
Ah, that warning from lein uberjar
suggests that your core ns does not have (:gen-class)
in the ns
form -- that's required for AOT compilation. Since you're omitting source from the JAR, there will be no .clj
file for Clojure to find -- which it is trying to do because Leiningen couldn't find the main class (because there was no (:gen-class)
in the ns
form), so it probably built the JAR to run clojure.main
as the main class. @U62LF4PT5
@U04V70XH6 The template included a (:gen-class)
in the core.clj file, it’s surprising to have this warning
(The git repo is: https://github.com/vnctaing/tartataing)
@U62LF4PT5
I don't see the tartataing.core
here (no core.clj file): https://github.com/vnctaing/tartataing/tree/main/src/clj/tartataing
But it's set as :main
in project.clj: https://github.com/vnctaing/tartataing/blob/main/project.clj#L49
:main ^:skip-aot tartataing.core
Ah, you only have it in your dev
folder - that's the reason I suppose it works with lein run
but doesn't work with uberjar: https://github.com/vnctaing/tartataing/blob/main/env/dev/clj/tartataing/core.clj
Any books for learning luminus or any detailed book that talks about web development in clojure? I tried some online resources but I found them to just skim through the basic ideas but not enough that I was hoping for... It would be great if it was free too
I have not read it, yet, but web development and luminus are covered in this book: https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/
The third edition is literally coming out next month, so yeah, it is surely up to date.
oh.. didn't know that. so if I were to buy should I buy now or wait? sorry maybe a bit stupid question ;( @U4P4NREBY
I've just downloaded OpenJDK 15 and installed it. I attempted to run a program that previously ran in this environment, but lein run errors out: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by clojure.lang.Reflector$$InjectedInvoker/0x0000000800bb4440 (file: .../.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar) to method com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(http://java.io.Reader) Any idea what's going on between Clojure 1.10.1 and OpenJDK 15? It looks like a runtime incompatibility of some sort. What versions of JDK does Clojure 1.10.1 support?
--illegal-access debug
are useful options. My guess is you're using clojure.xml, which is unofficially deprecated (will be officially in upcoming release). Switch to clojure.data.xml @fadrian
Thanks, @vincenz.chianese, @ghadi - The version I was using for com.vincit.clj-xsd.core was using an old version of clojure.data.xml (0.2.0-alpha2). I upgraded the xsd parser to alpha6, but the problem still remained. I downgraded to JDK-11 and that worked.
By the way I've tried OpenJ9 which says that uses low memory and rapid startup — it does not really seem to be the case
@vincenz.chianese Did you compare it with Clojure or pure Java?
what was your actual test @vincenz.chianese?
I have a zipper (locator), is there any function that will tell me the sequence of steps I need to follow from the root of the tree to reach it? (in e.g. zip/down zip/right...)
@U086BARD5’s zip library maintained history as you traversed. Doing it in reverse is a bit trickier obv but you should just be able to loop/recur to the top while counting how many left siblings you have at each level.
Is it in a loop? If so, it’s worth fixing
its not in a loop, its calls to .close
and .getResource
on my connection pools operating per request
Well that’s not going to be anything that you notice
So it’s a matter of how clean you want to be
the reason I am asking at all is because I remember hearing that method handles can be optimized by the JIT in java 8+