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); } }