You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting from spring-data-mongodb 3.4.3 (spring boot 2.7.4) when trying to use interface-based recusive projeection as described here, a ConverterNotFoundException is thrown (see example below).
You can find here a simple project for reproducing the issue.
Note that the issue is only reproducible when using reactive repositories and not when using blocking repositories.
Example:
java.lang.AssertionError: expectation "expectNextMatches" failed (expected: onNext(); actual: onError(org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.example.reactivemongoprojectionissue.bmodels.ApiSubTransaction] to type [com.example.reactivemongoprojectionissue.models.SubTransactionProjection]))
at reactor.test.MessageFormatter.assertionError(MessageFormatter.java:115)
at reactor.test.MessageFormatter.failPrefix(MessageFormatter.java:104)
at reactor.test.MessageFormatter.fail(MessageFormatter.java:73)
at reactor.test.MessageFormatter.failOptional(MessageFormatter.java:88)
at reactor.test.DefaultStepVerifierBuilder.lambda$expectNextMatches$11(DefaultStepVerifierBuilder.java:556)
at reactor.test.DefaultStepVerifierBuilder$SignalEvent.test(DefaultStepVerifierBuilder.java:2288)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onSignal(DefaultStepVerifierBuilder.java:1528)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onExpectation(DefaultStepVerifierBuilder.java:1476)
at reactor.test.DefaultStepVerifierBuilder$DefaultVerifySubscriber.onError(DefaultStepVerifierBuilder.java:1129)
at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.deferredError(FluxUsingWhen.java:398)
at reactor.core.publisher.FluxUsingWhen$RollbackInner.onComplete(FluxUsingWhen.java:475)
at reactor.core.publisher.Operators.complete(Operators.java:137)
at reactor.core.publisher.MonoEmpty.subscribe(MonoEmpty.java:46)
at reactor.core.publisher.Mono.subscribe(Mono.java:4455)
at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onError(FluxUsingWhen.java:364)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:255)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:134)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106)
at reactor.core.publisher.Operators.error(Operators.java:198)
at reactor.core.publisher.MonoError.subscribe(MonoError.java:53)
at reactor.core.publisher.Mono.subscribe(Mono.java:4455)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:255)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:383)
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:251)
at reactor.core.publisher.FluxCreate$BufferAsyncSink.drain(FluxCreate.java:814)
at reactor.core.publisher.FluxCreate$BufferAsyncSink.next(FluxCreate.java:739)
at reactor.core.publisher.FluxCreate$SerializedFluxSink.next(FluxCreate.java:161)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
The text was updated successfully, but these errors were encountered:
So there's a code snippet AbstractReactiveMongoQuery:L139-L141 that resets the type to read. However that one had been there even before 3.4.3 so it's likely the cause is another one.
Might be a side effect of 52886e1. But requires further investigation.
mp911de
changed the title
Recursive Interface-based projection not working as expected in reactive repositories since 3.4.3
Nested Interface-based projection fails with ConverterNotFoundExceptionJan 19, 2024
Uh oh!
There was an error while loading. Please reload this page.
Starting from spring-data-mongodb 3.4.3 (spring boot 2.7.4) when trying to use interface-based recusive projeection as described here, a ConverterNotFoundException is thrown (see example below).
You can find here a simple project for reproducing the issue.
Note that the issue is only reproducible when using reactive repositories and not when using blocking repositories.
Example:
The text was updated successfully, but these errors were encountered: