diff --git a/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java b/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java index 388c52604ad1c..f23b92c9df655 100644 --- a/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java +++ b/extensions/jsonb/deployment/src/main/java/io/quarkus/jsonb/deployment/JsonbProcessor.java @@ -3,6 +3,7 @@ import static org.jboss.jandex.AnnotationTarget.Kind.FIELD; import static org.jboss.jandex.AnnotationTarget.Kind.METHOD; +import java.beans.ConstructorProperties; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -15,8 +16,8 @@ import jakarta.json.bind.annotation.JsonbTypeSerializer; import jakarta.json.bind.serializer.JsonbDeserializer; import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.spi.JsonbProvider; -import org.eclipse.yasson.JsonBindingProvider; import org.eclipse.yasson.spi.JsonbComponentInstanceCreator; import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.AnnotationTarget; @@ -63,14 +64,15 @@ void build(BuildProducer reflectiveClass, BuildProducer serviceProvider, BuildProducer additionalBeans, CombinedIndexBuildItem combinedIndexBuildItem) { - reflectiveClass.produce( - ReflectiveClassBuildItem.builder(JsonBindingProvider.class.getName()).build()); resourceBundle.produce(new NativeImageResourceBundleBuildItem("yasson-messages")); serviceProvider.produce(new ServiceProviderBuildItem(JsonbComponentInstanceCreator.class.getName(), QuarkusJsonbComponentInstanceCreator.class.getName())); + // Accessed in jakarta.json.bind.spi.JsonbProvider.provider() + serviceProvider.produce(ServiceProviderBuildItem.allProvidersFromClassPath(JsonbProvider.class.getName())); + // this needs to be registered manually since the runtime module is not indexed by Jandex additionalBeans.produce(new AdditionalBeanBuildItem(JsonbProducer.class)); @@ -91,6 +93,9 @@ void build(BuildProducer reflectiveClass, reflectiveClass.produce( ReflectiveClassBuildItem.builder("java.lang.String").build()); + // register `java.beans.ConstructorProperties` as it's accessed through `io.quarkus.jsonb.JsonbProducer.jsonb` + reflectiveClass.produce(ReflectiveClassBuildItem.builder(ConstructorProperties.class).build()); + // Necessary for Yasson versions using MethodHandles (2.0+) reflectiveMethod.produce(new ReflectiveMethodBuildItem( getClass().getName(),