Skip to content

[Spring Boot 3.2.0] 404 Not Found behavior #38733

Closed as not planned
Closed as not planned
@infoShare

Description

@infoShare

404 Not found behavior was changed during upgrade from 3.1.6 to 3.2.0.

Previous behavior
404 Not found error returned:

{
    "timestamp": "2023-12-11T13:26:38.174+00:00",
    "status": 404,
    "error": "Not Found",
    "path": "/api/method"
}

Current behavior:
NoResourceFoundException thrown with message "No static resource api/method." thrown.

Here you can find small example:
https://github.com/infoShare/code-examples/tree/main/spring-boot-404

Test ApiControllerWithProfileTest is passing on spring boot 3.1.6

[INFO] Results:
[INFO] 
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

but failing on spring boot 3.2.0:

[ERROR] Failures: 
[ERROR]   ApiControllerWithProfileTest.executeMethod:40 
expected: 404 NOT_FOUND
 but was: 500 INTERNAL_SERVER_ERROR
[INFO] 
[ERROR] Tests run: 3, Failures: 1, Errors: 0, Skipped: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions