When I run this application on built-in server or other tomcat server it gives me following error message. I am using jdk8, STS V-3.9.7. Can someone help me resolve it
I think there is a version mismatch (possibly a Bug?) in Spring Boot.
Spring Boot 2.1.X uses Tomcat 9 which has the Servlet API v4.
But Spring Boot Web 2.1.X still incorporates Servlet API v3.1.
You should solve the problem by downgrading the spring-boot-starter-tomcat to version 2.0.X.
org.springframework.boot
spring-boot-starter-tomcat
2.0.7.RELEASE
test
Edit:
It might as well work just to change the Tomcat version property.
8.5.37