java.lang.IllegalArgumentException: Retrieved response [class java.util.ArrayList] is not convertible to a List of the expected response type [class io.axoniq.demo.hotel.booking.query.api.AccountResponseData]
at org.axonframework.messaging.responsetypes.MultipleInstancesResponseType.convert(MultipleInstancesResponseType.java:113) ~[axon-messaging-4.5.4.jar:4.5.4]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.FluxFilterFuseable] :
reactor.core.publisher.Flux.filter(Flux.java:5063)
org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206)
Error has been observed at the following site(s):
| Flux.filter ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206)
| Flux.map ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:207)
| Flux.transform ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:91)
| Flux.next ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:92)
| checkpoint ⇢ checkBugWithCheckPoint2
| Mono.map ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:150)
| Mono.flux ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:151)
| Flux.singleOrEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:129)
| Mono.switchIfEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:130)
| Mono.flatMap ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:134)
| checkpoint ⇢ Handler io.axoniq.demo.hotel.booking.query.web.rest.AccountQueryController#all() [DispatcherHandler]
| Mono.flatMap ⇢ at org.springframework.web.reactive.DispatcherHandler.lambda$handleResult$5(DispatcherHandler.java:182)
| Mono.onErrorResume ⇢ at org.springframework.web.reactive.DispatcherHandler.handleResult(DispatcherHandler.java:181)
| checkpoint ⇢ springfox.boot.starter.autoconfigure.SwaggerUiWebFluxConfiguration$CustomWebFilter [DefaultWebFilterChain]
| checkpoint ⇢ org.springframework.web.cors.reactive.CorsWebFilter [DefaultWebFilterChain]
| checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
| checkpoint ⇢ io.opentracing.contrib.spring.web.webfilter.TracingWebFilter [DefaultWebFilterChain]
| Mono.error ⇢ at org.springframework.web.server.handler.ExceptionHandlingWebHandler$CheckpointInsertingHandler.handle(ExceptionHandlingWebHandler.java:98)
|_ checkpoint ⇢ HTTP GET "/accounts" [ExceptionHandlingWebHandler]
Stack trace:
...
1: config:
spring.flyway.enabled=false spring.datasource.url=jdbc:mysql://localhost:3306/booking spring.datasource.username=root spring.datasource.password=12345678 spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect axon.serializer.general=JACKSON axon.serializer.events=JACKSON axon.serializer.messages=JACKSON
2: register account 3: curl -X GET -H "Accept:/" -H "Content-Type:application/x-www-form-urlencoded" "http://localhost:8080/accounts" 4: exception:
java.lang.IllegalArgumentException: Retrieved response [class java.util.ArrayList] is not convertible to a List of the expected response type [class io.axoniq.demo.hotel.booking.query.api.AccountResponseData] at org.axonframework.messaging.responsetypes.MultipleInstancesResponseType.convert(MultipleInstancesResponseType.java:113) ~[axon-messaging-4.5.4.jar:4.5.4] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Assembly trace from producer [reactor.core.publisher.FluxFilterFuseable] : reactor.core.publisher.Flux.filter(Flux.java:5063) org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206) Error has been observed at the following site(s): | Flux.filter ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:206) | Flux.map ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.getPayload(DefaultReactorQueryGateway.java:207) | Flux.transform ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:91) | Flux.next ⇢ at org.axonframework.extensions.reactor.queryhandling.gateway.DefaultReactorQueryGateway.query(DefaultReactorQueryGateway.java:92) | checkpoint ⇢ checkBugWithCheckPoint2 | Mono.map ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:150) | Mono.flux ⇢ at org.springframework.http.codec.json.AbstractJackson2Encoder.encode(AbstractJackson2Encoder.java:151) | Flux.singleOrEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:129) | Mono.switchIfEmpty ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:130) | Mono.flatMap ⇢ at org.springframework.http.codec.EncoderHttpMessageWriter.write(EncoderHttpMessageWriter.java:134) | checkpoint ⇢ Handler io.axoniq.demo.hotel.booking.query.web.rest.AccountQueryController#all() [DispatcherHandler] | Mono.flatMap ⇢ at org.springframework.web.reactive.DispatcherHandler.lambda$handleResult$5(DispatcherHandler.java:182) | Mono.onErrorResume ⇢ at org.springframework.web.reactive.DispatcherHandler.handleResult(DispatcherHandler.java:181) | checkpoint ⇢ springfox.boot.starter.autoconfigure.SwaggerUiWebFluxConfiguration$CustomWebFilter [DefaultWebFilterChain] | checkpoint ⇢ org.springframework.web.cors.reactive.CorsWebFilter [DefaultWebFilterChain] | checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain] | checkpoint ⇢ io.opentracing.contrib.spring.web.webfilter.TracingWebFilter [DefaultWebFilterChain] | Mono.error ⇢ at org.springframework.web.server.handler.ExceptionHandlingWebHandler$CheckpointInsertingHandler.handle(ExceptionHandlingWebHandler.java:98) |_ checkpoint ⇢ HTTP GET "/accounts" [ExceptionHandlingWebHandler] Stack trace: ...
located: org.axonframework.messaging.responsetypes.MultipleInstancesResponseType#convert response
because the parameter "response" is "ArrayList" , not expectedReponseType "io.axoniq.demo.hotel.booking.query.api.AccountResponseData"