启动spring boot 项目失败,异常信息:
s.c.a.AnnotationConfigApplicationContext:Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@6b26e945: startup date [***]; root of context hierarchy
o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
org.apache.zookeeper.ZooKeeper : Session: 0x16425de13520005 closed
org.apache.zookeeper.ClientCnxn : EventThread shut down
解决方法:检查pom.xml 依赖 spring-boot-starter 改为 spring-boot-starter-web
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency>
改为
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>重新启动,问题解决。