source

Spring WebFlux - Server Response Jackson Serializer 문제

ittop 2023. 10. 29. 19:59
반응형

Spring WebFlux - Server Response Jackson Serializer 문제

HTTP GET 요청을 웹 서버로 전송하는 동안 문제가 발생했습니다.다음은 이 리소스를 담당하는 코드 조각입니다.

@GetMapping("/events")
public Mono<ServerResponse> getEvents() {
    return ServerResponse.ok()
              .contentType(APPLICATION_JSON)
              .build();
}

요청을 보낼 때 예외가 발생합니다.

org.springframework.core.codec.CodecException: Type definition error: [simple type, class org.springframework.web.reactive.function.server.DefaultServerResponseBuilder$WriterFunctionServerResponse]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.web.reactive.function.server.DefaultServerResponseBuilder$WriterFunctionServerResponse and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
at org.springframework.http.codec.json.AbstractJackson2Encoder.encodeValue(AbstractJackson2Encoder.java:162) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.http.codec.json.AbstractJackson2Encoder.lambda$encode$0(AbstractJackson2Encoder.java:119) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:107) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxJust$WeakScalarSubscription.request(FluxJust.java:91) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1444) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1318) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable.subscribe(FluxMapFuseable.java:63) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Flux.subscribe(Flux.java:6873) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:200) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:80) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Flux.subscribe(Flux.java:6873) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onComplete(FluxConcatArray.java:200) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatArray.subscribe(FluxConcatArray.java:80) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMap.subscribe(FluxMap.java:59) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxContextStart.subscribe(FluxContextStart.java:49) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Flux.subscribe(Flux.java:6873) ~[reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.ipc.netty.channel.ChannelOperationsHandler.drain(ChannelOperationsHandler.java:461) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at reactor.ipc.netty.channel.ChannelOperationsHandler.flush(ChannelOperationsHandler.java:191) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:802) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at reactor.ipc.netty.NettyOutbound.lambda$sendObject$6(NettyOutbound.java:298) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at reactor.ipc.netty.FutureMono$DeferredFutureMono.subscribe(FutureMono.java:134) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.ipc.netty.NettyOutbound.subscribe(NettyOutbound.java:356) ~[reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapDelayed.drain(FluxConcatMap.java:749) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapDelayed.onNext(FluxConcatMap.java:581) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator$WriteBarrier.emitCachedSignals(ChannelSendOperator.java:282) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator$WriteBarrier.request(ChannelSendOperator.java:264) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:149) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapDelayed.onSubscribe(FluxConcatMap.java:567) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMap$MapSubscriber.onSubscribe(FluxMap.java:86) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator$WriteBarrier.subscribe(ChannelSendOperator.java:317) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.FluxSource.subscribe(FluxSource.java:52) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMap.subscribe(FluxMap.java:62) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreElements.subscribe(MonoIgnoreElements.java:37) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:148) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatIterable$ConcatIterableSubscriber.onComplete(FluxConcatIterable.java:141) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatIterable.subscribe(FluxConcatIterable.java:60) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreElements.subscribe(MonoIgnoreElements.java:37) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator$WriteBarrier.onNext(ChannelSendOperator.java:181) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxJust$WeakScalarSubscription.request(FluxJust.java:91) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator$WriteBarrier.onSubscribe(ChannelSendOperator.java:163) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable.subscribe(FluxMapFuseable.java:63) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at org.springframework.http.server.reactive.ChannelSendOperator.subscribe(ChannelSendOperator.java:74) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1073) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:198) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:198) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1073) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen$ThenAcceptInner.onNext(MonoIgnoreThen.java:290) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1073) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:144) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1073) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:241) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:323) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:185) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:92) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1630) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1444) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1318) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoDefaultIfEmpty.subscribe(MonoDefaultIfEmpty.java:37) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoPeek.subscribe(MonoPeek.java:71) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:128) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:148) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:271) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:803) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1630) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1444) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1318) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:418) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:210) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:128) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:61) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.Mono.subscribe(Mono.java:3080) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:167) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:70) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61) [reactor-core-3.1.6.RELEASE.jar:3.1.6.RELEASE]
at reactor.ipc.netty.channel.ChannelOperations.applyHandler(ChannelOperations.java:381) [reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at reactor.ipc.netty.http.server.HttpServerOperations.onHandlerStart(HttpServerOperations.java:397) [reactor-netty-0.7.6.RELEASE.jar:0.7.6.RELEASE]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[netty-transport-4.1.23.Final.jar:4.1.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) ~[netty-common-4.1.23.Final.jar:4.1.23.Final]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_141]
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.web.reactive.function.server.DefaultServerResponseBuilder$WriterFunctionServerResponse and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1191) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:312) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1396) ~[jackson-databind-2.9.5.jar:2.9.5]
at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:913) ~[jackson-databind-2.9.5.jar:2.9.5]
at org.springframework.http.codec.json.AbstractJackson2Encoder.encodeValue(AbstractJackson2Encoder.java:159) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]
... 136 common frames omitted

저는 스프링부트 2.0.1을 사용합니다.풀어주다.제가 이 문제를 해결할 수 있도록 도와주시겠습니까?감사하겠습니다.

ServerResponse는 반응형 웹 프레임워크의 기능적 변형인 Spring WebFlux.fn에서 사용되는 HTTP 응답 유형입니다.주석이 달린 컨트롤러 안에서 사용하면 안 됩니다.

이 경우, 당신은 A를 반환해야 합니다.ResponseEntity대신(또는 기타 지원되는 반환 유형, 참조 문서 참조).

언급URL : https://stackoverflow.com/questions/50024730/spring-webflux-serverresponse-jackson-serializer-problems

반응형