Fork me on GitHub
#graalvm
<
2023-02-19
>
Adam Helins20:02:56

I'm getting a weird runtime exception in my native image about a class missing but only when it is used in promesa.core/catch . This class is used plenty elsewhere without any trouble, it is present beyond any doubt :thinking_face: Can't find much intel about that DynamicHub.java but it looks sus...

[{:type java.util.concurrent.ExecutionException,
    :message
    "java.lang.ClassNotFoundException: convex.core.lang.impl.ErrorValue",
    :at
    [java.util.concurrent.CompletableFuture
     reportGet
     "CompletableFuture.java"
     396]}
   {:type java.lang.ClassNotFoundException,
    :message "convex.core.lang.impl.ErrorValue",
    :at [java.lang.Class forName "DynamicHub.java" 1136]}],
  :trace
  [[java.lang.Class forName "DynamicHub.java" 1136]
   [clojure.lang.RT classForName "RT.java" 2209]
   [clojure.lang.RT classForName "RT.java" 2218]
   [convex.shell.req.testnet$_post$fn__8909 invoke "testnet.clj" 43]
   [clojure.core$comp$fn__5876 invoke "core.clj" 2586]
   [promesa.impl$fn__5234$fn__5235 invoke "impl.cljc" 114]
   [promesa.util.Function2 apply "util.cljc" 64]
   [java.util.concurrent.CompletableFuture
    uniHandle
    "CompletableFuture.java"
    934]
...

phronmophobic20:02:52

not sure what the issue might be, but http://grep.app shows some hits for dynamic hub https://grep.app/search?q=dynamichub

Adam Helins20:02:55

Must be about somehow about reflection... I remain puzzled about that error message

borkdude21:02:33

What is in convex.shell.req.testnet?

Adam Helins21:02:34

A Clojure namespace, that line refers to the lambda passed to promesa.core/catch

Adam Helins21:02:11

Hang on a second, perhaps I'm being stupid

borkdude21:02:20

Have you enabled (set! *warn-on-reflection* true) in that namespace?

Adam Helins21:02:22

Arg, yes I was missing a single type hint, seems fixed. Not quite fond of that error message though, it kinda misses the point :thinking_face:

borkdude21:02:50

Class/forName says enough imo ;)

Adam Helins21:02:10

In retrospect yes, thanks!

👍 1