springboot 运行出现错误 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

原因是我将springboot启动类换到了另外一个方法中

出现了一个异常   

 

后来发现因为我换了类但是忘记了换类名所以才报错

@ComponentScan
@EnableAutoConfiguration
public class TestApplication {

    public static void main(String[] args){
        SpringApplication.run(TestApplication.class,args);

    }

}

 

posted @ 2019-09-20 14:15  纳兰容若♫  阅读(8293)  评论(2编辑  收藏  举报