Upgrade the servlet-api to latest version javax.servlet:javax.servlet-api:jar:4.0.1
Annotate APIs with nullability annotations.
Catch a IOException that is thrown from GlassFish due to bug in GlassFish where it attempts to write to a closed connection. This avoids spurious error messages appearing in the logs.
Remove the AbstractProxyServlet.rewriteUrlFromRequest(...) method from the public API of the servlet as no downstream users override method.