Skip to content

ErrorPageRegistrarBeanPostProcessor is not auto-configured in war deployments and the ErrorPageCustomizer is not applied #49176

Closed
jayychoi wants to merge 1 commit intospring-projects:mainfrom
jayychoi:war-error-page
Closed

ErrorPageRegistrarBeanPostProcessor is not auto-configured in war deployments and the ErrorPageCustomizer is not applied #49176
jayychoi wants to merge 1 commit intospring-projects:mainfrom
jayychoi:war-error-page

Conversation

@jayychoi
Copy link
Copy Markdown
Contributor

@jayychoi jayychoi commented Feb 10, 2026

Closes gh-49148

In Spring Boot 4, ErrorPageRegistrarBeanPostProcessor is only registered in ServletWebServerConfiguration, which is not active in WAR deployments. This causes exceptions to bypass Spring's error handling and expose the servlet container's default error page.

This commit registers ErrorPageRegistrarBeanPostProcessor as a static @Bean in ErrorPageFilterConfiguration, which is loaded exclusively in WAR mode via SpringBootServletInitializer

Closes spring-projectsgh-49148

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 10, 2026
@snicoll snicoll self-assigned this Mar 3, 2026
@snicoll snicoll changed the title Register ErrorPageRegistrarBeanPostProcessor in WAR deployments ErrorPageRegistrarBeanPostProcessor is not auto-configured in war deployments and the ErrorPageCustomizer is not applied Mar 3, 2026
@snicoll snicoll added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 3, 2026
@snicoll snicoll added this to the 3.5.12 milestone Mar 3, 2026
@snicoll snicoll modified the milestones: 3.5.12, 4.0.4 Mar 3, 2026
snicoll pushed a commit that referenced this pull request Mar 3, 2026
See gh-49176

Signed-off-by: Jay Choi <jayyoungchoi22@gmail.com>
snicoll added a commit that referenced this pull request Mar 3, 2026
@snicoll snicoll closed this in b8786e0 Mar 3, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 3, 2026

Good stuff, thanks @jayychoi - I've added a system test for our war deployment to validate the error page works as expected, see 2a80a3c

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

Successfully merging this pull request may close these issues.

ErrorPageRegistrarBeanPostProcessor is not auto-configured in war deployments and the ErrorPageCustomizer is not applied

3 participants