graalvm

Adam Helins 2023-02-19T20:48:56.095039Z

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 🤔 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]
...

phronmophobic 2023-02-19T20:53:52.888039Z

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

Adam Helins 2023-02-19T20:57:55.677519Z

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

borkdude 2023-02-19T21:06:33.509699Z

What is in convex.shell.req.testnet?

Adam Helins 2023-02-19T21:09:34.403429Z

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

Adam Helins 2023-02-19T21:10:11.419669Z

Hang on a second, perhaps I'm being stupid

borkdude 2023-02-19T21:10:20.704049Z

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

Adam Helins 2023-02-19T21:14:22.214029Z

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

borkdude 2023-02-19T21:14:50.159449Z

Class/forName says enough imo ;)

Adam Helins 2023-02-19T21:16:10.032679Z

In retrospect yes, thanks!

👍 1