JUnit test with javax.websocket on embedded Jetty throws RejectedExecutionException: NonBlockingThread

雨燕双飞 提交于 2019-12-02 02:55:58

Don't mix versions of Jetty.

This is an unfortunate side effect of the design of the JSR-356 API. (The Client implementation is the root implementation, and the Server implementation is built on top of that)

The Client container is initialized per JVM, and each server container is initialized per webapp.

Your stacktrace is not Jetty 9.2.0.RC0 as you indicated (the line numbers are off)

https://github.com/eclipse/jetty.project/blob/jetty-9.2.0.RC0/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectionManager.java#L200

They seem to be from Jetty 9.1.5.v20140505

https://github.com/eclipse/jetty.project/blob/jetty-9.1.5.v20140505/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/ConnectionManager.java#L200

Use Jetty 9.2.2.v20140723 everywhere.

Also, using this version means you can get rid of the finally container.stop() hack.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!