Skip to content

ErrorController not called for non existing APIs after upgrade to Spring Boot 3.3.3(from 2.7.0) #44150

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

Closed
jirou97 opened this issue Feb 6, 2025 · 1 comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid

Comments

@jirou97
Copy link

jirou97 commented Feb 6, 2025

Issue: ErrorController Not Called After Upgrading to Spring Boot 3.3.3

Hello everyone, this is my first time raising an issue, so please be patient with me.

Problem Description

After upgrading from Spring Boot 2.7.0 to 3.3.3, the ErrorController implementation is no longer called for non-existing APIs.
This worked fine in Spring Boot 2.7.0.

Reproduction

I have attached two demos that reproduce this issue.
You can run the test and see in the 3.3.3 version that the non-existing API returns 404 NOT FOUND instead of calling the ErrorController.

demo-spring-boot-2.7.0.zip
demo-spring-boot-3.3.3.zip

Could you investigate what is the source of this behaviour?

Thanks ☮

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 6, 2025
@wilkinsona
Copy link
Member

This is due to spring-projects/spring-framework#29491. A NoHandlerFoundException is now thrown which you can handle as needed to meet your needs. You may also want to review your use of @EnableWebMvc which is disabling Spring Boot's auto-configuration of Spring MVC.

If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2025
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: stackoverflow A question that's better suited to stackoverflow.com and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stackoverflow A question that's better suited to stackoverflow.com status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants