Case 1:
@SpringBootApplication
annotation missing in your spring boot starter class.
Case 2:
For non-web applications, disable web application type
in the properties file.
In application.properties
:
spring.main.web-application-type=none
If you use application.yml
then add:
spring:
main:
web-application-type: none
For web applications, extends *SpringBootServletInitializer*
in the main class.
@SpringBootApplication
public class YourAppliationName extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(YourAppliationName.class, args);
}
}
Case 3:
If you use spring-boot-starter-webflux
then also add spring-boot-starter-web
as dependency.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…