RuedigerMoeller / fast-serialization

FST: fast java serialization drop in-replacement
Apache License 2.0
1.59k stars 245 forks source link

SerializationConstructorAccessor class not found for declaringClass: [Ljava.lang.Object; #351

Open imgoby opened 8 months ago

imgoby commented 8 months ago

version 3.0.4-jdk17

Exception is as follow:


com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor class not found for declaringClass: [Ljava.lang.Object; (targetConstructorClass: java.lang.Object). Usually adding [Ljava.lang.Object; to serialization-config.json fixes the problem.
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89) ~[na:na]
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.serialize.SerializationSupport.getSerializationConstructorAccessor(SerializationSupport.java:143) ~[na:na]
    at java.base@17.0.5/jdk.internal.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:48) ~[na:na]
    at java.base@17.0.5/jdk.internal.reflect.ReflectionFactory.generateConstructor(ReflectionFactory.java:463) ~[na:na]
    at java.base@17.0.5/jdk.internal.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:376) ~[na:na]
    at jdk.unsupported@17.0.5/sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:100) ~[na:na]
    at org.nustaq.serialization.FSTDefaultClassInstantiator.findConstructorForSerializable(FSTDefaultClassInstantiator.java:110) ~[na:na]
    at org.nustaq.serialization.FSTClazzInfo.<init>(FSTClazzInfo.java:136) ~[spring-cloud-alibaba-fst-native-image:na]
    at org.nustaq.serialization.FSTClazzInfoRegistry.getCLInfo(FSTClazzInfoRegistry.java:129) ~[na:na]
    at org.nustaq.serialization.FSTClazzNameRegistry.addClassMapping(FSTClazzNameRegistry.java:97) ~[na:na]
    at org.nustaq.serialization.FSTClazzNameRegistry.registerClassNoLookup(FSTClazzNameRegistry.java:84) ~[na:na]
    at org.nustaq.serialization.FSTClazzNameRegistry.registerClass(FSTClazzNameRegistry.java:80) ~[na:na]
    at org.nustaq.serialization.FSTConfiguration.addDefaultClazzes(FSTConfiguration.java:844) ~[spring-cloud-alibaba-fst-native-image:na]
    at org.nustaq.serialization.FSTConfiguration.initDefaultFstConfigurationInternal(FSTConfiguration.java:478) ~[spring-cloud-alibaba-fst-native-image:na]
    at org.nustaq.serialization.FSTConfiguration.createDefaultConfiguration(FSTConfiguration.java:473) ~[spring-cloud-alibaba-fst-native-image:na]
    at org.nustaq.serialization.FSTConfiguration.createDefaultConfiguration(FSTConfiguration.java:465) ~[spring-cloud-alibaba-fst-native-image:na]
wuxindao commented 4 months ago

我也遇到了, 解决不了SerializationConstructorAccessor class not found for declaringClass: com.sh.commons.tuple.TwoTuple (targetConstructorClass: java.lang.Object). Usually adding com.sh.commons.tuple.TwoTuple to serialization-config.json fixes the problem.