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