Repository navigation
Closed
Labels
Description
GraalVM CE 1.0 RC6 breaks converting the Flank fat jar to a native executable.
$ git clone https://github.com/TestArmada/flank.git
$ cd test_runner
$ ./gradlew clean assemble fatJar
$ build/libs
$ native-image -jar flank-3.0-SNAPSHOT.jar
./flank-3.0-SNAPSHOT
Exception in thread "main" picocli.CommandLine$InitializationException: Cannot instantiate subcommand ftl.cli.FirebaseCommand: the class has no constructor
at java.lang.Throwable.<init>(Throwable.java:287)
at java.lang.Exception.<init>(Exception.java:84)
at java.lang.RuntimeException.<init>(RuntimeException.java:80)
at picocli.CommandLine$PicocliException.<init>(CommandLine.java:8801)
at picocli.CommandLine$InitializationException.<init>(CommandLine.java:8808)
at picocli.CommandLine$Model$CommandReflection.initSubcommands(CommandLine.java:4912)
at picocli.CommandLine$Model$CommandReflection.updateCommandAttributes(CommandLine.java:4877)
at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:4858)
at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:3144)
at picocli.CommandLine.<init>(CommandLine.java:147)
at picocli.CommandLine.<init>(CommandLine.java:126)
at picocli.CommandLine.run(CommandLine.java:1700)
at picocli.CommandLine.run(CommandLine.java:1647)
at ftl.Main.main(Main.kt:34)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:163)
Caused by: java.lang.NoSuchMethodException: ftl.cli.FirebaseCommand.<init>()
at java.lang.Throwable.<init>(Throwable.java:265)
at java.lang.Exception.<init>(Exception.java:66)
at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:56)
at java.lang.NoSuchMethodException.<init>(NoSuchMethodException.java:51)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at picocli.CommandLine$DefaultFactory.create(CommandLine.java:2832)
at picocli.CommandLine$Model$CommandReflection.initSubcommands(CommandLine.java:4906)
... 9 more
Reacted by Remko Popma
Activity
cstancu commentedon Sep 4, 2018
Did this work with rc5? From the error message it looks like you need to register
ftl.cli.FirebaseCommand.<init>()for reflection access.bootstraponline commentedon Sep 4, 2018
Interesting. I'll try to define a reflectconfig. RC5 didn't work either.
bootstraponline commentedon Sep 6, 2018
Image building is failing after I defined a reflection config JSON.
I opened a pull request so you can easily reproduce the problem:
dougxc commentedon Sep 6, 2018
@cstancu @christianwimmer this looks like the same thing I commented on in #656.
cstancu commentedon Feb 8, 2019
@bootstraponline the
java.lang.NoClassDefFoundErrorthat your reported after adding the correct reflection configuration was fixed in RC12. You will need to add this options tonative-image:--report-unsupported-elements-at-runtime --allow-incomplete-classpath. Also you need to fix thegraal_reflectionconfig.jsonby removing theftl.cli.firebase.test.android.AndroidRefreshCommandandftl.cli.firebase.test.ios.IosRefreshCommandentries as those classes don't exist anymore. I guessfirebaseremoved them since you filed this issue.However, I still cannot successfully build an image for your app. I hit the same problem reported in #783:
Non-instantiated type referenced by a compiled method: kotlin.Result$Companion.I am closing this issue. Please follow the progress of #783.
bootstraponline commentedon Feb 8, 2019
Thank you for looking into this! I'm excited about using graalvm in the future.
cstancu commentedon Feb 12, 2019
#783 has been fixed. Now using this command:
and this reflection configuration file:
I can build an executable which when run does something:
I am not familiar with the internals of your project so I stopped there. I just wanted to see how far I can get it.
bootstraponline commentedon Feb 13, 2019
Thanks. I made a simple reproducible example that doesn't require authentication with a service account.
It's awesome to see GraalVM making progress. 🙂