Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServer

Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServer_第1张图片错误原因:

SpringApplication.run();中的类名书写错误,应该是写成springboot启动类的类名而不是其他的

如下所示,我启动类的类名为Main,那么在run方法中应该为Main.class而不是其它

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

你可能感兴趣的:(mistakes,java,开发语言,intellij-idea,后端,spring,boot)