Wiremock: can not work with jetty 9.4.35.v20201120

Created on 26 Dec 2020  路  4Comments  路  Source: tomakehurst/wiremock

Bug reports

  • [x] Which version of WireMock you're using
    2.27.2
    jetty version: 9.4.35.v20201120
    jetty is not the default 9.4.30.v20200611, because jetty old version have some vulnerability problem.
  • [x] How you're starting and configuring WireMock, including configuration or CLI the command line
        WireMockConfiguration config = WireMockConfiguration.wireMockConfig()
            .dynamicPort() // proxy port
            .dynamicHttpsPort()// mocker port
            .enableBrowserProxying(true);
        mockServer = new WireMockServer(config);
        mockServer.start();
  • [x] A failing test case that demonstrates the problem

    • set log level to debug

    • register any stub

    • set web browser proxy to the proxy port

    • send request from web browser

      will print ClassCastException

java.lang.ClassCastException: class org.eclipse.jetty.io.ssl.SslConnection cannot be cast to class org.eclipse.jetty.server.HttpConnection (org.eclipse.jetty.io.ssl.SslConnection and org.eclipse.jetty.server.HttpConnection are in unnamed module of loader 'app')
    at org.eclipse.jetty.server.HttpInputOverHTTP.produceContent(HttpInputOverHTTP.java:33)
    at org.eclipse.jetty.server.HttpInput.consumeAll(HttpInput.java:721)
    at org.eclipse.jetty.server.HttpConnection.onCompleted(HttpConnection.java:412)
    at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:820)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:368)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
    at [email protected]/java.lang.Thread.run(Thread.java:834)

when change jetty version from 9.4.35.v20201120 to 9.4.34.v20201102, there is no problem.

Most helpful comment

Upgraded to latest Jetty 9.x in 64294f0a2a39c3eb308734d5bb73b6c6e16dc49a

All 4 comments

when work with jetty version 9.4.36.v20210114, have the same problem too.

Not very surprising, but it does also not work with Jetty 10 or 11.

Could you please prioritize this?

Upgraded to latest Jetty 9.x in 64294f0a2a39c3eb308734d5bb73b6c6e16dc49a

Was this page helpful?
0 / 5 - 0 ratings