my code is as follow:
Class clazz= Float.class;
Class curCl = clazz;
while (Serializable.class.isAssignableFrom(curCl)) {
curCl = curCl.getSuperclass();
if (curCl == null) {
return ;
}
}
Constructor c = curCl.getDeclaredConstructor((Class[]) null);
c = ReflectionFactory.getReflectionFactory().newConstructorForSerialization(clazz, c);
excetpion is as follow:
10:44:06.842 logback [main] ERROR o.s.boot.SpringApplication - Application run failed
com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor class not found for declaringClass: [F (targetConstructorClass: java.lang.Object). Usually adding [F to serialization-config.json fixes the problem.
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.serialize.SerializationSupport.getSerializationConstructorAccessor(SerializationSupport.java:143)
at java.base@17.0.5/jdk.internal.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:48)
at java.base@17.0.5/jdk.internal.reflect.ReflectionFactory.generateConstructor(ReflectionFactory.java:463)
at java.base@17.0.5/jdk.internal.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:376)
at jdk.unsupported@17.0.5/sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:100)
But I have set the serialization-config.json file:
{
"lambdaCapturingTypes": [],
"types": [
{
"name": "[F"
}]
}
the exception reproduces.how to resolve it?
Comment From: wilkinsona
This isn't the right place for questions about GraalVM. Please ask in one of the GraalVM community's support channels instead.