The getExpirationDate() Method of the ExpiresFilter throws a ClassCastException when the following conditions hold: 1. the request is ServletRequestWrapper 2. an inner request implements the interface org.apache.catalina.servlet4preview.http.HttpServletRequest Then the method will throw a ClassCastException in line 1296 of org.apache.catalina.filters.ExpiresFilter. Log Message observed: Our application uses a custom implementation of a ServletRequestWrapper. The ClassCastException logs that our custom implementation cannot be cast to org.apache.catalina.servlet4preview.http.HttpServletRequest Root Cause ========== The root cause is that if-conditon in line 1295 checks that innerRequest is an instance of servlet4preview.http.HttpServletRequest, yet in line 1296 the request (rather than the innerRequest) is casted. Out Tomcat Settings: ==================== We use Tomcat 8.5.49 with Connector-Protocol org.apache.coyote.http11.Http11NioProtocol.
Thanks for the report. Fixed in: - 8.5.x for 8.5.50 onwards Only 8.5.x was affected.