I got this same error message when running Tomcat9 with Spring Boot 3.3.5 and Java21. However, when I upgraded to Tomcat10 the error went away. The only issue is that on Ubuntu you need to also upgrade by minimum to 24.04 to get tomcat10 from apt package management. Of course you can do also vanilla installation.