Subscrption failed with exception #1535
-
I tried to use @Component
class Subscriptions(val postService: PostService) : Subscription {
fun commentAdded(): Flow<Comment> {
return postService.commentAdded()
}
} and I declared When testing the subscrption, it returns exceptions. 2022-09-04 16:58:11.453 DEBUG 48048 --- [ctor-http-nio-2] o.s.w.r.s.a.ReactorNettyWebSocketSession : [2b183577] Session id "2b183577" for ws://localhost:50906/subscriptions
2022-09-04 16:58:11.453 DEBUG 48048 --- [ctor-http-nio-2] o.s.w.r.s.c.ReactorNettyWebSocketClient : Started session '2b183577' for ws://localhost:50906/subscriptions
2022-09-04 16:58:11.453 DEBUG 48048 --- [ctor-http-nio-3] o.s.w.r.s.a.ReactorNettyWebSocketSession : [669ed656-5] Session id "6b1acc24" for http://localhost:50906/subscriptions
2022-09-04 16:58:11.499 DEBUG 48048 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter : [669ed656-5] Completed 200 OK
2022-09-04 16:58:11.543 ERROR 48048 --- [ctor-http-nio-3] .s.s.s.ApolloSubscriptionProtocolHandler : Error running graphql subscription
java.util.concurrent.CompletionException: java.lang.NoSuchMethodError: 'graphql.execution.instrumentation.ExecutionStrategyInstrumentationContext graphql.execution.instrumentation.Instrumentation.beginExecutionStrategy(graphql.execution.instrumentation.parameters.InstrumentationExecutionStrategyParameters, graphql.execution.instrumentation.InstrumentationState)'
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1194) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309) ~[na:na]
at graphql.GraphQL.parseValidateAndExecute(GraphQL.java:556) ~[graphql-java-18.3.jar:na]
at graphql.GraphQL.executeAsync(GraphQL.java:524) ~[graphql-java-18.3.jar:na]
at graphql.GraphQL.execute(GraphQL.java:450) ~[graphql-java-18.3.jar:na]
at com.expediagroup.graphql.server.spring.subscriptions.SpringGraphQLSubscriptionHandler.executeSubscription(SpringGraphQLSubscriptionHandler.kt:49) ~[graphql-kotlin-spring-server-6.2.2.jar:6.2.2]
at com.expediagroup.graphql.server.spring.subscriptions.ApolloSubscriptionProtocolHandler.startSubscription(ApolloSubscriptionProtocolHandler.kt:133) ~[graphql-kotlin-spring-server-6.2.2.jar:6.2.2]
at com.expediagroup.graphql.server.spring.subscriptions.ApolloSubscriptionProtocolHandler.handle(ApolloSubscriptionProtocolHandler.kt:67) ~[graphql-kotlin-spring-server-6.2.2.jar:6.2.2]
at com.expediagroup.graphql.server.spring.subscriptions.SubscriptionWebSocketHandler.handle$lambda-0(SubscriptionWebSocketHandler.kt:35) ~[graphql-kotlin-spring-server-6.2.2.jar:6.2.2]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:386) ~[reactor-core-3.4.22.jar:3.4.22]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200) ~[reactor-core-3.4.22.jar:3.4.22]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) ~[reactor-core-3.4.22.jar:3.4.22]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) ~[reactor-core-3.4.22.jar:3.4.22]
at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:113) ~[reactor-core-3.4.22.jar:3.4.22]
at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:279) ~[reactor-netty-core-1.0.22.jar:1.0.22]
at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:388) ~[reactor-netty-core-1.0.22.jar:1.0.22]
at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:404) ~[reactor-netty-core-1.0.22.jar:1.0.22]
at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:604) ~[reactor-netty-http-1.0.22.jar:1.0.22]
at reactor.netty.http.server.WebsocketServerOperations.onInboundNext(WebsocketServerOperations.java:169) ~[reactor-netty-http-1.0.22.jar:1.0.22]
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93) ~[reactor-netty-core-1.0.22.jar:1.0.22]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299) ~[netty-codec-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496) ~[netty-transport-4.1.79.Final.jar:4.1.79.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.79.Final.jar:4.1.79.Final]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.lang.NoSuchMethodError: 'graphql.execution.instrumentation.ExecutionStrategyInstrumentationContext graphql.execution.instrumentation.Instrumentation.beginExecutionStrategy(graphql.execution.instrumentation.parameters.InstrumentationExecutionStrategyParameters, graphql.execution.instrumentation.InstrumentationState)'
at com.expediagroup.graphql.generator.execution.FlowSubscriptionExecutionStrategy.execute(FlowSubscriptionExecutionStrategy.kt:61) ~[graphql-kotlin-schema-generator-6.2.2.jar:6.2.2]
at graphql.execution.Execution.executeOperation(Execution.java:159) ~[graphql-java-18.3.jar:na]
at graphql.execution.Execution.execute(Execution.java:105) ~[graphql-java-18.3.jar:na]
at graphql.GraphQL.execute(GraphQL.java:641) ~[graphql-java-18.3.jar:na]
at graphql.GraphQL.lambda$parseValidateAndExecute$11(GraphQL.java:561) ~[graphql-java-18.3.jar:na]
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[na:na]
... 44 common frames omitted The complete testing codes is here: https://github.com/hantsy/spring-graphql-sample/blob/master/graphql-kotlin/src/test/kotlin/com/example/demo/DemoApplicationTests.kt |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
hello, this is related to the https://github.com/ExpediaGroup/graphql-kotlin/blob/master/gradle.properties#L26 |
Beta Was this translation helpful? Give feedback.
hello, this is related to the
graphql-java
version that is getting override by spring (18.3)please explicitly specify
graphql-java 19.1
https://github.com/ExpediaGroup/graphql-kotlin/blob/master/gradle.properties#L26