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 也是這個問題