Eureka客户端报错:Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient'


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 也是这个问题


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM