When I generate a new Spring Boot app (4.0.0.M3) from start.spring.io using the "War" option, the assembled WAR will not start properly on Tomcat 11.
Steps to reproduce:
- Go to https://start.spring.io/ and choose: Gradle, Groovy, 4.0.0 (M3), War packaging, Java 17
- Add Spring Boot Actuator to the dependencies
- Click Generate
- Expand the downloaded ZIP file
- Add the following settings to src/main/resources/application.properties:
spring.application.name=demo
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.endpoint.health.probes.enabled=true
management.endpoint.health.group.liveness.include=ping
management.endpoint.health.group.readiness.include=ping
- Run
.\gradlew assemble
from the project root - Rename the generated war in
build/libs
toROOT.war
- Copy ROOT.war to tomcat
webapps
in Tomcat 11 - Wait for the webapp to start, then go to
http://localhost:8080/actuator/health/readiness
Expected behavior: Tomcat should expand the WAR (if autodeploy is set to true) and start the webapp. Tomcat stdout log should indicate that the DispatcherServlet is initialized The readiness probe should return a 200 response with status: UP
(I verified that this procedure works in spring boot 3.5.6)
Actual behavior: The WAR is expanded, and appears to be deployed The stdout indicates that ServletInitializer started, but it does not contain an initialization message from DispatcherServlet. The readiness probe returns a 404 error.