Problem happens with Spring Boot 3.0.0. 2.7.6 works fine.

Sample code:

package de.diskostu.demo.springboottutorial;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class SpringBootTutorialApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootTutorialApplication.class, args);
    }


    @GetMapping
    public String hello() {
        return "Hello world!";
    }
}

expected: URL http://localhost:8080 should deliver a text "Hello world!". happens:

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Dec 02 16:55:38 CET 2022
There was an unexpected error (type=Not Found, status=404).

Spring Boot 2.7.6 works just fine.

Comment From: bclozel

Closing as a duplicate of spring-projects/spring-framework#29625