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 ☮

Comment From: wilkinsona

This is due to https://github.com/spring-projects/spring-framework/issues/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.