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

后端 未结 1 1353
执念已碎
执念已碎 2021-01-25 08:50

I\'m trying to write a test case which creates a socket and connects to an embedded jetty instance. I\'m using

  • Jetty: 9.2.0.RC0
  • javax.websocket-api &
1条回答
  •  后悔当初
    2021-01-25 09:37

    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.

    0 讨论(0)
提交回复
热议问题