Native application throws com.oracle.svm.core.jdk.UnsupportedFeatureError in runtime, while using java.lang.reflect.Array to generate a new instance of an object encapsulated in a generic. Adding a type hint did not solve the issue.
The error is observed only when such operation is inside a dependency. Extracting the code from the library and putting it into the application being compiled, seem to trigger a proper reflection autoconfiguration.
It would be interesting to understand how that specific reflection hit can be provided in the native-image configuration.
Also it's crashing when using Jakarta RESTful WS API but not when using QuarkusApplication. Working example commented in the repo.
curl --request POST --url http://localhost:8080/test
More details
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:121)
at java.base@21.0.2/java.lang.reflect.Array.multiNewArray(Array.java:409)
at java.base@21.0.2/java.lang.reflect.Array.newInstance(Array.java:114)
at org.hipparchus.util.MathArrays.buildArray(MathArrays.java:1628)
at org.hipparchus.geometry.euclidean.threed.FieldRotation.<init>(FieldRotation.java:247)
at org.orekit.frames.LOFType$3.rotationFromInertial(LOFType.java:151)
Describe the issue
Native application throws com.oracle.svm.core.jdk.UnsupportedFeatureError in runtime, while using java.lang.reflect.Array to generate a new instance of an object encapsulated in a generic. Adding a type hint did not solve the issue.
The error is observed only when such operation is inside a dependency. Extracting the code from the library and putting it into the application being compiled, seem to trigger a proper reflection autoconfiguration.
It would be interesting to understand how that specific reflection hit can be provided in the native-image configuration.
Also it's crashing when using Jakarta RESTful WS API but not when using
QuarkusApplication
. Working example commented in the repo.Steps to reproduce the issue
git clone git@github.com:tomgelu/native-image-issue.git
cd native-image-issue
docker build -f src/main/docker/Dockerfile.native-micro -t native-image-issue:test .
docker run -p 8080:8080 native-image-issue:test
curl --request POST --url http://localhost:8080/test
More details