From 6da0db8913742906b2082015ddf91f26bdc1cde5 Mon Sep 17 00:00:00 2001 From: David Becker Date: Thu, 24 Jun 2021 15:29:36 -0700 Subject: [PATCH] Fix java.lang.IllegalStateException: Unsupported extension type: ... When a ReactiveMongoRepository uses an @Query annotation, I get a java.lang.IllegalStateException: Unsupported extension type: org.springframework.data.jpa.repository.support.JpaEvaluationContextExtension thrown by ReactiveExtensionAwareEvaluationContextProvider after upgrading to spring-data-commons 2.4x+. It appears that the if (it instanceof EvaluationContextExtension) { clause is missing a return Mono.empty(); when extensionFilter.test(information) returns false like if (it instanceof ReactiveEvaluationContextExtension) { has. This allows it to fall through and return the Mono.error(...). Closes #2392 --- .../spel/ReactiveExtensionAwareEvaluationContextProvider.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/springframework/data/spel/ReactiveExtensionAwareEvaluationContextProvider.java b/src/main/java/org/springframework/data/spel/ReactiveExtensionAwareEvaluationContextProvider.java index 44ea5e8369..a42ec8bc0b 100644 --- a/src/main/java/org/springframework/data/spel/ReactiveExtensionAwareEvaluationContextProvider.java +++ b/src/main/java/org/springframework/data/spel/ReactiveExtensionAwareEvaluationContextProvider.java @@ -125,6 +125,8 @@ private Mono> getExtensions( if (extensionFilter.test(information)) { return Mono.just(extension); } + + return Mono.empty(); } if (it instanceof ReactiveEvaluationContextExtension) {