Describe the bug
When trying to use Alexa SDK with Quarkus, it works in non-native mode, but fails when compiling in native mode.
Expected behavior
I would expect it to compile smoothly in native mode.
Actual behavior
The compilation fails because of reference to unsupported methods.
For instance:
Error: Unsupported method java.lang.Thread.suspend0() is reachable: Native method. If you intend to use the Java Native Interface (JNI), specify -H:+JNI and see also -H:JNIConfigurationFiles=<path> (use -H:+PrintFlags for details)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Call path from entry point to java.lang.Thread.suspend0():
at java.lang.Thread.suspend0(Thread.java)
at java.lang.Thread.suspend(Thread.java:1032)
at com.oracle.svm.reflect.Thread_suspend_24fd610340ceeb89fae387dad76129cadeeda10a_48.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:498)
at javax.enterprise.util.AnnotationLiteral.invoke(AnnotationLiteral.java:288)
at javax.enterprise.util.AnnotationLiteral.getMemberValue(AnnotationLiteral.java:276)
at javax.enterprise.util.AnnotationLiteral.toString(AnnotationLiteral.java:135)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at com.oracle.svm.core.amd64.AMD64CPUFeatureAccess.verifyHostSupportsArchitecture(AMD64CPUFeatureAccess.java:179)
at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:129)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:186)
at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:133)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:579)
... 6 more
To Reproduce
Steps to reproduce the behavior:
mvn archetype:generate -DarchetypeGroupId=io.quarkus -DarchetypeArtifactId=quarkus-amazon-lambda-archetype -DarchetypeVersion=1.1.0.Finalcom.amazon.alexa:ask-sdk:2.27.1 dependency to pom.xmlnew SkillStreamHandler(Skills.standard().build()){} in the constructor of TestLambda classmvn clean install -Pnative -Dnative-image.docker-build=trueEnvironment
That basically means we need an extension for making Alexa SDK work with GraalVM.
Hello @fcracker79,
Does using the following command work:
mvn clean install -Pnative -Dnative-image.docker-build=true -Dquarkus.native.enable-jni=true
Thanks @jaikiran, it worked!
Please let me know if I need to close the issue.
If it just needs JNI to work, I think we can close that one as JNI will be always enabled once we move to GraalVM 19.3.
My issue is solved.