1. Java 学习社区首页
  2. Java
  3. Spring

Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

先确定依赖是否正确:

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

确认是否有@SpringBootApplication注解:

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("com.changmi.ucenter.mapper")
public class UCenterApplication {

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

}

原创文章,如若转载,请注明出自:http://www.javaobj.com/2020/05/unable-to-start-servletwebserverapplicationcontext-due-to-missing-servletwebserverfactory-bean/

发表评论

电子邮件地址不会被公开。 必填项已用*标注