Fork me on GitHub

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 (\nCould not locate <my_repo_name>/core__init.class, <my_repo_name>/core.clj or <my_repo_name>/core.cljc on classpath.\n",
  {: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


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


@U62LF4PT5 I don't see the tartataing.core here (no core.clj file): But it's set as :main in project.clj:

: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:


Ah adding a gen-class to file in the prod folder made the error disappear thanks !

Chris K09:10:05

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:

Chris K10:10:09

is this book up to date? and would I get new copies if it gets updated?


The third edition is literally coming out next month, so yeah, it is surely up to date.

Chris K10:10:11

oh.. didn't know that. so if I were to buy should I buy now or wait? sorry maybe a bit stupid question ;( @U4P4NREBY


Read the link for terms and conditions


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 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?


I also had likely the same issue (with both HotSpot and J9), downgraded to 11 for now.


--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 @fadrian


Thanks, @vincenz.chianese, @ghadi - The version I was using for com.vincit.clj-xsd.core was using an old version of (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.


Running a Pedestal app with Clojure


how bad is the performance cost of reflection for stuff that isn't numerics?


(I just set *warn-on-reflection* to true and I got yelled at)




not deployed yet - hobby project

Alex Miller (Clojure team)23:10:23

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

Alex Miller (Clojure team)23:10:01

Well that’s not going to be anything that you notice

Alex Miller (Clojure team)23:10:00

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+


So i didn't know if clojure does its reflection in a way that can be optimized (or if it could)


not that it is a mission critical performance thing - I haven't measured and I have zero users