-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
Description
I was having native-image spit out errors:
com.oracle.svm.core.jdk.UnsupportedFeatureError: SerializationConstructorAccessor class not found for declaringClass: java.lang.String (targetConstructorClass: java.lang.Object). Usually adding java.lang.String to serialization-config.json fixes the problem
It turns out the fix is trivial, as apparently one can contribute entries to the serialization-config.json by using
@RegisterForReflection(targets = { String.class }, serialization = true)
Unfortunately the guide at https://quarkus.io/guides/writing-native-applications-tips doesn't mention neither the serialization-config.json and the serialization attribute of @RegisterForReflection.
Implementation ideas
It would be nice to add a section, especially keeping in mind the language used by the GraalVM native-image error: while we don't normally expect people to create files such as serialization-config.json, I suspect they will be searching for related instructions.
zakkak
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
To do