前提:maven项目,自己写的spring boot 启动类。
启动报异常信息如下:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
解决方案:
一、启动类忘记添加注解
在main方法所在的类忘记添加@SpringBootApplication;
检查自己的启动类,果然是忘记添加注解。添加注解之后,启动成功。
前提:maven项目,自己写的spring boot 启动类。
启动报异常信息如下:Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean
解决方案:
在main方法所在的类忘记添加@SpringBootApplication;
检查自己的启动类,果然是忘记添加注解。添加注解之后,启动成功。