1 Commits

Author SHA1 Message Date
Adrien 0c226483c0 fix deserialization error in native image 2026-04-18 20:46:16 +02:00
@@ -5,6 +5,8 @@ import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import java.util.List;
/**
* GraalVM native-image runtime hints for third-party libraries that use reflection
* or classpath resource scanning not covered by Spring Boot's AOT processor.
@@ -64,6 +66,20 @@ public class NativeHintsConfig implements RuntimeHintsRegistrar {
software.amazon.awssdk.services.s3.S3Client.class,
MemberCategory.INVOKE_PUBLIC_METHODS
);
// Jackson deserialization of records persisted as JSON in DB columns.
// These are reached only via ObjectMapper.readValue in services, so Spring's
// BindingReflectionHintsRegistrar does not auto-discover all accessors.
for (Class<?> type : List.of(
com.aiteacher.topic.TopicSummaryResponse.class,
com.aiteacher.topic.TopicSummaryResponse.SourceReference.class,
com.aiteacher.concept.ConceptReportResponse.class,
com.aiteacher.concept.ConceptReportResponse.FacetSection.class
)) {
hints.reflection().registerType(type,
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS);
}
}
private void registerJBossLogger(RuntimeHints hints, String className) {