From da13574e3c74b15b1a8aea7a336eef361cb31b59 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Fri, 5 Jul 2024 12:23:56 +0300 Subject: [PATCH] Fix native issue with @Providers when only the REST Client exists When the server part of Quarkus REST is not included, prior to this change, user's @Provider classes were not registered for reflection Relates to: https://github.com/quarkusio/quarkus/issues/41705 --- .../reactive/deployment/RestClientReactiveProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java index 07d3e0cebed69d..3ccb72cce60880 100644 --- a/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java @@ -311,6 +311,10 @@ void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem, int.class), constructor.getThis(), constructor.loadClassFromTCCL(providerDotName.toString()), constructor.load(priority)); + + // when the server is not included, providers are not automatically registered for reflection, + // so we need to always do it for the client to be on the safe side + reflectiveClassesProducer.produce(ReflectiveClassBuildItem.builder(providerDotName.toString()).build()); } }