From 0c8e2bbbf64ab0e2d19bc7f28b935b652f5a2b49 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 9 Feb 2023 09:04:23 +0200 Subject: [PATCH] Never register server specific providers in REST Client Fixes: #31024 --- .../deployment/RestClientReactiveProcessor.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java index c34febe9f0420..5f4b7ca72aafe 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java @@ -293,18 +293,25 @@ void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem, continue; } } + DotName providerDotName = providerClass.name(); + // don't register server specific types + if (providerDotName.equals(ResteasyReactiveDotNames.CONTAINER_REQUEST_FILTER) + || providerDotName.equals(ResteasyReactiveDotNames.CONTAINER_RESPONSE_FILTER) + || providerDotName.equals(ResteasyReactiveDotNames.EXCEPTION_MAPPER)) { + continue; + } if (providerClass.interfaceNames().contains(ResteasyReactiveDotNames.FEATURE)) { continue; // features should not be automatically registered for the client, see javadoc for Feature } - int priority = getAnnotatedPriority(index, providerClass.name().toString(), Priorities.USER); + int priority = getAnnotatedPriority(index, providerDotName.toString(), Priorities.USER); constructor.invokeVirtualMethod( MethodDescriptor.ofMethod(AnnotationRegisteredProviders.class, "addGlobalProvider", void.class, Class.class, int.class), - constructor.getThis(), constructor.loadClassFromTCCL(providerClass.name().toString()), + constructor.getThis(), constructor.loadClassFromTCCL(providerDotName.toString()), constructor.load(priority)); } }