spring boot 项目启动后失败,报Unregistering JMX-exposed beans on shutdown

报错截图截图如下:

这里写图片描述

解决方法:

将pom文件中添加如下依赖

        <dependency>  
            <groupId>org.springframework.boot</groupId>  
            <artifactId>spring-boot-starter-tomcat</artifactId>  
        </dependency>  
  • 1
  • 2
  • 3
  • 4

另,如果不行,尝试再将下面依赖:

        <dependency>  
            <groupId>org.springframework.boot</groupId>  
            <artifactId>spring-boot-starter</artifactId>  
        </dependency>  
  • 1
  • 2
  • 3
  • 4

改为

        <dependency>  
            <groupId>org.springframework.boot</groupId>  
            <artifactId>spring-boot-starter-web</artifactId>  
        </dependency>  
  • 1
  • 2
  • 3
  • 4

ps: 我两种情况都遇到过,在idea中直接使用第一种方法即可。后来换了台电脑,项目需要在Eclipse运行,报同样的错误,做了以上两步,Spring boot 项目又可以重新启动运行了

猜你喜欢

转载自blog.csdn.net/CatEatApple/article/details/81201802