Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
spring boot版本2.0.04.release
spring cloud版本Finchley.SR1
pom文件里加入下边的依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
原因是Finchley.SR1版本spring-cloud-starter-netflix-eureka-client里面不在包含spring-boot-starter-web依赖
旧版只有web一种模式,默认使用web。新版还包含webflux,需新增依赖spring-boot-starter-web 或者
spring-boot-starter-webflux
另外:Completed shut down of DiscoveryClient Unregistering JMX-exposed beans on shutdown 也是这个问题