Fork me on GitHub
#graalvm
<
2020-05-10
>
tees01:05:30

Heyo. I'm trying to compile again with graal using a file watcher library. I'm getting this error when running the server:

JVM Exception: #error {
 :cause Class java.nio.file.StandardWatchEventKinds$StdWatchEventKind[] is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection
 :via
I've tried adding this reflection file, but without much luck:
[
  {
    "name" : "java.nio.file.StandardWatchEventKinds",
    "allDeclaredConstructors" : true,
    "allPublicConstructors" : true,
    "allDeclaredMethods" : true,
    "allPublicMethods" : true,
    "allDeclaredClasses" : true,
    "allPublicClasses" : true
  }
]
Anybody have any advice ?

borkdude06:05:47

@tees you need to register the array, not the class element

tees11:05:15

Ok, thanks. I suppose I took the wording Register the class by using... too literally.

tees11:05:51

It works! Thanks so much (again)!

sogaiu11:05:47

\o/

😅 4
🙃 4