Fork me on GitHub
#graalvm
<
2020-05-03
>
lvh03:05:38

FYI I'm hitting: Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of http://java.io.FilePermission are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Detailed message: Trace: Object was reached by reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant [email protected] reached by indexing into array constant java.util.concurrent.ConcurrentHashMap$Node[]@2ac46e53 reached by reading field java.util.concurrent.ConcurrentHashMap.table of constant [email protected] reached by reading field http://java.io.FilePermissionCollection.perms of constant http://java.io[email protected] reached by reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant [email protected] reached by indexing into array constant java.util.concurrent.ConcurrentHashMap$Node[]@4b4549be reached by reading field java.util.concurrent.ConcurrentHashMap.table of constant [email protected] reached by reading field java.security.Permissions.permsMap of constant [email protected] reached by reading field java.security.ProtectionDomain.permissions of constant ja[email protected] reached by indexing into array constant java.security.ProtectionDomain[]@7374ce00 reached by reading field java.security.AccessControlContext.context of constant [email protected] reached by reading field http://java.net.URLClassLoader.acc of constant [email protected] reached by reading field java.lang.Class.classLoader of constant [email protected] reached by Hub

lvh03:05:49

which I can only find examples of via search to this channel

lvh03:05:07

This is with 20.0.0 + jdk11, which unfortunately I need

lvh03:05:12

(jdk11, that is)

lvh03:05:33

https://github.com/latacora/wernicke master if anyone wants to try for themselves

flowthing11:05:12

I'm working on something I want to compile to a native binary using GraalVM. I'm making somewhat heavy use of Java interop. To make the resulting binary work, I have to pepper my codebase with type hints. I can compile the binary (using clj.native-image) just fine, but when I neglect to add a type hint somewhere, the binary throws a type-related exception when I run it. The problem is that the feedback loop is pretty long: to detect any missing type hints, I first need to compile the native image (which can take quite long) and then run it. Is there any way to shorten the feedback loop? Is there an option I can pass to the native image compiler to make it report the type errors, for example? Or can I leverage *warn-on-reflection* somehow?

borkdude12:05:21

@flowthing Yes, *warn-on-reflection* is what you want to enable everywhere you do Java interop

flowthing17:05:36

Thanks! I do set it in my entry point namespace, but I guess I should set it in every namespace where I do Java interop. Will give it a try.

borkdude17:05:39

yes, every namespace

👀 4
flowthing17:05:00

Gotcha. :thumbsup: