Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to resolve this exception: com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor #39795

Closed
imgoby opened this issue Feb 29, 2024 · 1 comment
Labels
status: invalid An issue that we don't feel is valid

Comments

@imgoby
Copy link

imgoby commented Feb 29, 2024

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?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 29, 2024
@wilkinsona
Copy link
Member

This isn't the right place for questions about GraalVM. Please ask in one of the GraalVM community's support channels instead.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants