Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorPageSecurityFilter prevents deployment to a Servlet 3.1 compatible container #28790

Closed
wilkinsona opened this issue Nov 23, 2021 · 3 comments
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Nov 23, 2021

As identified by this answer on Stack Overflow, ErrorPageSecurityFilter extends HttpFilter which is new in Servlet 4.0. As we support deployment to Servlet 3.1-compatible containers, we should implement Filter instead and then cast the request and response to HttpServletRequest and HttpServletResponse as needed.

@benjamin-sailer
Copy link

benjamin-sailer commented Dec 23, 2021

Unfortunately I've still a problem along the lines of this issue: I've been trying to make a spring boot application (version 2.6.1) run on tomcat 8.5 (supporting only servlet-api version 3.1).

So I'm pulling the (provided) servlet-api 3.1 dependency of the interface javax.servlet.Filter(javax.servlet:javax.servlet-api:3.1.0) which is supplied without default implementation of the init-method; the implementation of org.springframework.boot.web.servlet.filter.ErrorPageSecurityFilter however seems to rely on a different interface definition (that contains the default implementation of the init method, coming from org.apache.tomcat.embed:tomcat-embed-core:9.0.52), not implementing itself.

So I end up with an
org.apache.catalina.core.StandardContext.filterStart Ausnahme beim Starten des Filters [errorPageSecurityFilter] java.lang.AbstractMethodError at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
during startup. Maybe I'm doing something wrong in my project configuration, so help is appreciated, else I suspect that the default init implementation does not help.

I know my configuration is not really straight forward so probably I'm missing something here, but maybe it would be better not to rely on the default implementation for an interface definition the version of which is not fully under spring control (e.g. meant to be provided by the external container).

@philwebb
Copy link
Member

philwebb commented Jan 7, 2022

@benjamin-sailer I think you're seeing a duplicate of #28902. Can you please try to upgrade to Spring Boot 2.6.2.

@benjamin-sailer
Copy link

benjamin-sailer commented Jan 7, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

4 participants