This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-31
Channels
- # announcements (6)
- # babashka (40)
- # beginners (6)
- # calva (1)
- # cider (1)
- # clerk (43)
- # clj-kondo (3)
- # clojure (93)
- # clojure-denver (8)
- # clojure-europe (52)
- # clojure-norway (20)
- # clojure-sweden (7)
- # community-development (5)
- # datascript (15)
- # datomic (30)
- # emacs (24)
- # events (15)
- # fulcro (23)
- # graalvm (12)
- # gratitude (1)
- # helix (4)
- # honeysql (4)
- # hoplon (39)
- # hyperfiddle (7)
- # introduce-yourself (1)
- # jobs (1)
- # jobs-discuss (26)
- # lambdaisland (3)
- # lsp (6)
- # matcher-combinators (2)
- # matrix (5)
- # meander (39)
- # nrepl (4)
- # nyc (1)
- # off-topic (5)
- # portal (73)
- # practicalli (1)
- # re-frame (2)
- # reitit (22)
- # releases (1)
- # remote-jobs (4)
- # shadow-cljs (5)
- # sql (17)
- # testing (1)
- # tools-deps (15)
Hi, I am having a problem. I am trying to compile Datahike as a babashka-pod. Datahike is compiled as graalvm-bin everytime without problem. Now I added datahike as dep to a repo with my babashka-pod-code. But it fails with this error:
Error: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected. To see
how this object got instantiated use --trace-object-instantiation=java.util.Random. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Trace: Object was reached by
reading field taoensso.timbre$fn__17542$deterministic_rand__17543.rand of constant
taoensso.timbre$fn__17542$deterministic_rand__17543@29cd7371: taoensso.timbre$fn__17542$deterministic_rand__17543@29cd7371
reading field clojure.lang.Var.root of constant
clojure.lang.Var@28d6e056: #'taoensso.timbre/deterministic-rand
indexing into array java.lang.Object[]@1b4ee29b: [Ljava.lang.Object;@1b4ee29b
reading field clojure.lang.PersistentHashMap$BitmapIndexedNode.array of constant
clojure.lang.PersistentHashMap$BitmapIndexedNode@5841cbdf: clojure.lang.PersistentHashMap$BitmapIndexedNode@5841cbdf
indexing into array clojure.lang.PersistentHashMap$INode[]@5148db66: [Lclojure.lang.PersistentHashMap$INode;@5148db66
reading field clojure.lang.PersistentHashMap$ArrayNode.array of constant
clojure.lang.PersistentHashMap$ArrayNode@3f8fa0b: clojure.lang.PersistentHashMap$ArrayNode@3f8fa0b
indexing into array clojure.lang.PersistentHashMap$INode[]@34872ee8: [Lclojure.lang.PersistentHashMap$INode;@34872ee8
reading field clojure.lang.PersistentHashMap$ArrayNode.array of constant
clojure.lang.PersistentHashMap$ArrayNode@286ec6e2: clojure.lang.PersistentHashMap$ArrayNode@286ec6e2
reading field clojure.lang.PersistentHashMap.root of constant
clojure.lang.PersistentHashMap@5940e049: {default-output-msg-fn #'taoensso.timbre/default-output-msg-fn, get-rate-limiter...
reading field java.util.concurrent.atomic.AtomicReference.value of constant
java.util.concurrent.atomic.AtomicReference@43207ef8: {default-output-msg-fn #'taoensso.timbre/default-output-msg-fn, get-rate-limiter...
reading field clojure.lang.Namespace.mappings of constant
clojure.lang.Namespace@6acabec7: taoensso.timbre
reading field clojure.lang.Var.ns of constant
clojure.lang.Var@7b824581: #'taoensso.timbre/default-timestamp-opts
scanning root clojure.lang.Var@7b824581: #'taoensso.timbre/default-timestamp-opts embedded in
taoensso.timbre$_log_BANG_$fn__17518.invoke(timbre.cljc:665)
I don't use timbre in my pod-code, why does it fail now? Any idea?Somewhere you or a dependency must be using timbre else you wouldn't get this error :)
https://github.com/ptaoussanis/timbre/commit/6a980e0a537d35d076ecdda2113e194943b6dba4
Let me ask more on this. What if I had a 3rd-party Java library which spawns an instance of Random in a class? Obviously I cannot fix their code.
Asking because some time ago I had this with the official DynamoDB SDK. I wrote my own client in pure HTTP but anyway I'd like to know how to solve such kind of issues (cc @U04V15CAJ)