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

2023-12-25 15:54:37 浏览数 (16)

问题:

我是在创建SpringBoot项目时候,项目跑不起来,控制台打印的是

  .   ____          _            __ _ _  /\ / ___'_ __ _ _(_)_ __  __ _ ( ( )___ | '_ | '_| | '_ / _` |  \/  ___)| |_)| | | | | || (_| |  ) ) ) )   '  |____| .__|_| |_|_| |___, | / / / /  =========|_|==============|___/=/_/_/_/  :: Spring Boot ::        (v1.4.7.RELEASE) 2017-10-02 08:47:16.734  INFO 4048 --- [           main] c.e.demo.SpringBootTestApplication       : Starting SpringBootTestApplication on DESKTOP-7O0ES0O with PID 4048 (E:stsWorkSpaceSpringBoot_Testtargetclasses started by 柴火 in E:stsWorkSpaceSpringBoot_Test) 2017-10-02 08:47:16.734  INFO 4048 --- [           main] c.e.demo.SpringBootTestApplication       : No active profile set, falling back to default profiles: default 2017-10-02 08:47:16.812  INFO 4048 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@df27fae: startup date [Mon Oct 02 08:47:16 CST 2017]; root of context hierarchy 2017-10-02 08:47:17.890  INFO 4048 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup 2017-10-02 08:47:17.921  INFO 4048 --- [           main] c.e.demo.SpringBootTestApplication       : Started SpringBootTestApplication in 1.634 seconds (JVM running for 2.256) 2017-10-02 08:47:17.921  INFO 4048 --- [       Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@df27fae: startup date [Mon Oct 02 08:47:16 CST 2017]; root of context hierarchy 2017-10-02 08:47:17.937  INFO 4048 --- [       Thread-1] o.s.j.e.a.AnnotationMBeanExporter        :Unregistering JMX-exposed beans on shutdown

解决办法:

pom文件中有一个这样的依赖

代码语言:javascript复制
<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>

修改为

代码语言:javascript复制
<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

0 人点赞