From 2a567df32c844a076eeb876f65a43756413b457f 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/quarkiverse/quarkus-langchain4j/issues/722 --- .../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 07d3e0cebed69..3ccb72cce6088 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()); } }