This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-17
Channels
- # aleph (4)
- # announcements (2)
- # babashka (85)
- # beginners (136)
- # calva (72)
- # clj-commons (32)
- # clj-kondo (7)
- # cljs-dev (3)
- # clojure (117)
- # clojure-europe (38)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-uk (4)
- # clojurescript (19)
- # conjure (38)
- # core-logic (2)
- # cursive (10)
- # datalevin (1)
- # datalog (1)
- # datomic (6)
- # events (2)
- # fulcro (16)
- # google-cloud (5)
- # graphql (10)
- # gratitude (3)
- # hugsql (3)
- # luminus (5)
- # membrane-term (12)
- # missionary (2)
- # nextjournal (5)
- # off-topic (3)
- # pedestal (2)
- # polylith (7)
- # portal (3)
- # re-frame (6)
- # reagent (26)
- # reclojure (8)
- # releases (3)
- # reveal (5)
- # shadow-cljs (14)
- # spacemacs (20)
- # sql (3)
- # tools-build (3)
- # web-security (9)
I'm totally blocked and not able to debug the following error. I stopped the repl and tried to run again but I'm getting this
Caused by: java.lang.ClassCastException: class mount.core.DerefableState cannot be cast to class clojure.lang.IFn (mount.core.DerefableState is in unnamed module of loader clojure.lang.DynamicClassLoader @4fe875be; clojure.lang.IFn is in unnamed module of loader 'app')
at socn.db.core$eval15854$fn__15855.invoke(core.clj:14)
lein repl
inside the project is having the same problem
I read that is something related to the db.core/**db**
that is required before it's started but I'm not sure where is this happening.
(ns socn.db.core
(:require
[cheshire.core :refer [generate-string parse-string]]
[next.jdbc.date-time]
[next.jdbc.prepare]
[next.jdbc.result-set]
[clojure.tools.logging :as log]
[conman.core :as conman]
[socn.config :refer [env]]
[mount.core :refer [defstate]])
(:import (org.postgresql.util PGobject)))
(defstate ^:dynamic *db*
:start (if-let [jdbc-url (env :database-url)]
(conman/connect! {:jdbc-url jdbc-url})
(do
(log/warn "database connection URL was not found, please set :database-url in your config, e.g: dev-config.edn")
*db*))
:stop (conman/disconnect! *db*))
Does that happen when starting the server or when trying to start the repl?
What flags have you added when creating the new lein template? Does the error happens when starting the repl or when starting the server? Could we get a glimpse at the full stacktrace?
Reading the errors from lein repl
I found the problem. I was testing a function call that I wrote outside a comment
macro. My fault 😞
Thanks @iglesiastj for you help anyway!
You are welcome. That one error happens to me a lot too!