I'm got above exception and I'm using Dropwizard 1.1.2 and jetty-server 9.4.2.v20170220. Client is not setting any encoding header explicitly and Dropwizard. I'm not sure which compatibility I'm breaking. Extended stack trace is as below.

 at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
! at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:241)
! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:52)
! at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:674)
! at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:64)
1

There are 1 best solutions below

0
Joakim Erdfelt On

Jetty 9.x is now at End of Community Support.

You should upgrade very soon.

See announcment: https://github.com/eclipse/jetty.project/issues/7958

Also, your version of Jetty, 9.4.2, is subject to many vulnerabilities.

See https://www.eclipse.org/jetty/security_reports.php

And your version of Dropwizard 1.1.2 is way past support from dropwizard as well.

See announcement declaring 1.3.x End of Life in Dec 2020 - https://groups.google.com/g/dropwizard-user/c/6gpDMuSb4_Y/m/poqbA4T9BQAJ

Back to the heart of your issue, that combination of versions is unsupported.

Dropwizard 1.x with Jetty 9.x

This is because Jetty 9.x is using Servlet 3.1, which introduced the Async I/O features, that makes supporting Wrapped Servlet Request / Response streams for GZIP impossible.

See issue https://github.com/dropwizard/dropwizard/pull/2566

If you want Jetty 9.x, with Gzip, then use Dropwizard 2.x.

But even this combination is a dead end for support.

Keep an eye out for Dropwizard 3.x or Dropwizard 4.x for up to date support of Jetty 10.x or Jetty 11.x