spring boot初始化报错

解决方法:web

将pom文件中添加以下依赖spring

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

    1
    2
    3
    4ide

另,若是不行,尝试再将下面依赖:spring-boot

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

    1
    2
    3
    4blog

改成ip

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

    1
    2
    3
    4cli

ps: 我两种状况都遇到过,在idea中直接使用第一种方法便可。后来换了台电脑,项目须要在Eclipse运行,报一样的错误,作了以上两步,Spring boot 项目又能够从新启动运行了。