NoSuchMethodError when switching protocols to WebSockets
See original GitHub issueI’m getting an exception while attempting to listen for inbound WebSocket connections with 0.9.1-alpha-8
:
2018-01-14 09:26:50 [nettyCallPool-4-2] ERROR ktor.application - 101 Switching Protocols: GET - /ws
java.lang.NoSuchMethodError: kotlinx.coroutines.experimental.channels.ActorKt.actor(Lkotlin/coroutines/experimental/CoroutineContext;ILkotlinx/coroutines/experimental/CoroutineStart;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/experimental/channels/SendChannel;
at io.ktor.websocket.WebSocketWriter.<init>(WebSocketWriter.kt:10)
at io.ktor.websocket.RawWebSocketImpl.<init>(RawWebSocketImpl.kt:18)
at io.ktor.websocket.WebSocketUpgrade.upgrade(WebSocketUpgrade.kt:37)
at io.ktor.server.netty.http1.NettyHttp1ApplicationResponse.respondUpgrade(NettyHttp1ApplicationResponse.kt:69)
at io.ktor.server.engine.BaseApplicationResponse.respondOutgoingContent$suspendImpl(BaseApplicationResponse.kt:62)
at io.ktor.server.engine.BaseApplicationResponse.respondOutgoingContent(BaseApplicationResponse.kt)
at io.ktor.server.netty.NettyApplicationResponse.respondOutgoingContent$suspendImpl(NettyApplicationResponse.kt:39)
at io.ktor.server.netty.NettyApplicationResponse.respondOutgoingContent(NettyApplicationResponse.kt)
at io.ktor.server.engine.BaseApplicationResponse$$special$$inlined$apply$lambda$1.doResume(BaseApplicationResponse.kt:33)
at io.ktor.server.engine.BaseApplicationResponse$$special$$inlined$apply$lambda$1.invoke(BaseApplicationResponse.kt)
at io.ktor.server.engine.BaseApplicationResponse$$special$$inlined$apply$lambda$1.invoke(BaseApplicationResponse.kt:14)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.pipeline.PipelineContext.proceedWith(PipelineContext.kt:20)
at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$1.doResume(DefaultTransform.kt:15)
at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$1.invoke(DefaultTransform.kt)
at io.ktor.server.engine.DefaultTransformKt$installDefaultTransformations$1.invoke(DefaultTransform.kt)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.pipeline.Pipeline.execute(Pipeline.kt:16)
at io.ktor.websocket.RoutingKt.respondWebSocketRaw(Routing.kt:131)
at io.ktor.websocket.RoutingKt$webSocketRaw$1$1$1$1.doResume(Routing.kt:28)
at io.ktor.websocket.RoutingKt$webSocketRaw$1$1$1$1.invoke(Routing.kt)
at io.ktor.websocket.RoutingKt$webSocketRaw$1$1$1$1.invoke(Routing.kt)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.pipeline.Pipeline.execute(Pipeline.kt:16)
at io.ktor.routing.Routing.executeResult(Routing.kt:88)
at io.ktor.routing.Routing.interceptor(Routing.kt:18)
at io.ktor.routing.Routing$Feature$install$1.doResume(Routing.kt:59)
at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt:44)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.features.CallLogging$Feature$install$1.doResume(CallLogging.kt:42)
at io.ktor.features.CallLogging$Feature$install$1.invoke(CallLogging.kt)
at io.ktor.features.CallLogging$Feature$install$1.invoke(CallLogging.kt:34)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.pipeline.Pipeline.execute(Pipeline.kt:16)
at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.doResume(DefaultEnginePipeline.kt:66)
at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
at io.ktor.pipeline.PipelineContext.proceed(PipelineContext.kt:31)
at io.ktor.pipeline.Pipeline.execute(Pipeline.kt:16)
at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.doResume(NettyApplicationCallHandler.kt:25)
at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt:10)
at kotlinx.coroutines.experimental.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:51)
at kotlinx.coroutines.experimental.CoroutineStart.invoke(CoroutineStart.kt:115)
at kotlinx.coroutines.experimental.BuildersKt.launch(Builders.kt:66)
at kotlinx.coroutines.experimental.BuildersKt.launch$default(Builders.kt:58)
at kotlinx.coroutines.experimental.BuildersKt.launch(Builders.kt:77)
at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:20)
at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:14)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:353)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
at java.lang.Thread.run(Thread.java:748)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Jetty, websockets and java.lang.NoSuchMethodError
I've try with javax.WebSocket and import org.eclipse.jetty.websocket.WebSocket. Always the same error. I would like to run a specific method in ...
Read more >NoSuchMethodError during establishing websocket connection
There is a simple embeddedServer created with SSL and Netty. It works OK with HTTPS requests. I tries to add some route for...
Read more >Angular CLI Behind the Scenes Part Two
The first is a web socket request - this allows client-side code to exchange arbitrary, non-HTTP data with a server. If you've been...
Read more >Writing a WebSocket server in Java - Web APIs | MDN
First steps. WebSockets communicate over a TCP (Transmission Control Protocol) connection. Java's ServerSocket class is located in the java.net ...
Read more >18 Using the WebSocket Protocol in WebLogic Server
The WebLogic Server implementation of the WebSocket protocol and its ... HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It should have been fixed, so I’m closing it. If it still doesn’t work for you, let us know.
I responded on Slack, forgot to post it here, sorry.
0.9.1-alpha-9
is out with upgrade of kotlinx.coroutines, check it out.