From 7d2114be263a686ca9fffed2edc26b5ced771c5c Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Fri, 3 Sep 2021 08:59:16 +0200 Subject: [PATCH 1/2] Bug Report: CDI tries to instantiate interface (Jersey 2.30) Signed-off-by: Jorge Bescos Gascon --- .../jersey/ext/cdi1x/internal/CdiComponentProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java index 214f3c1df9..f0b3b090d5 100644 --- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java +++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java @@ -204,7 +204,7 @@ private boolean bind(final Class clazz, final Set> providerContracts final boolean isJaxRsResource = runtimeSpecifics.isJaxRsResource(clazz); if (isJaxRsResource && !runtimeSpecifics.isAcceptableResource(clazz)) { - LOGGER.warning(LocalizationMessages.CDI_NON_INSTANTIABLE_COMPONENT(clazz)); + LOGGER.info(LocalizationMessages.CDI_NON_INSTANTIABLE_COMPONENT(clazz)); return false; } From 0dab7c7c8e45be4223d25327c0fd92aa7c2438bc Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Mon, 6 Sep 2021 10:04:18 +0200 Subject: [PATCH 2/2] Decrease logger to fine Signed-off-by: Jorge Bescos Gascon --- .../jersey/ext/cdi1x/internal/CdiComponentProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java index f0b3b090d5..9d42f002c5 100644 --- a/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java +++ b/ext/cdi/jersey-cdi1x/src/main/java/org/glassfish/jersey/ext/cdi1x/internal/CdiComponentProvider.java @@ -204,7 +204,8 @@ private boolean bind(final Class clazz, final Set> providerContracts final boolean isJaxRsResource = runtimeSpecifics.isJaxRsResource(clazz); if (isJaxRsResource && !runtimeSpecifics.isAcceptableResource(clazz)) { - LOGGER.info(LocalizationMessages.CDI_NON_INSTANTIABLE_COMPONENT(clazz)); + LOGGER.log(clazz.isInterface() ? Level.FINE : Level.WARNING, + LocalizationMessages.CDI_NON_INSTANTIABLE_COMPONENT(clazz)); return false; }