记录一次 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

1、把https://start.spring.io/创建的项目导入



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.4.RELEASE
         
    
    com.example
    springBootDemo
    0.0.1-SNAPSHOT
    springBootDemo
    Demo project for Spring Boot

    
        1.8
    

    
        
        
            org.springframework.boot
            spring-boot-devtools
            true
        
        
            org.springframework.boot
            spring-boot-starter-web
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    

2、注掉自带测试类
记录一次 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean_第1张图片
3、在controller上面加上注解记录一次 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean_第2张图片

4、弄个main方法 然后自动导包,run一下
记录一次 Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean_第3张图片

解决办法:根源暂时没找到,但是把controller的SpringBootApplication注解、main方法删了,把注释掉的DemoApplication打开,这样能行

等找到根源了再来继续写~~~

你可能感兴趣的:(springboot)