Error creating bean with name 'eurekaInstanceConfigBean': Singleton bean creation not allowed while singletons of this factory are in destruction

这一生的挚爱 提交于 2019-12-23 04:55:22

问题


This question is extension of Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient. On my windows machine JAVA_HOME and PATH both versions where different. I just corrected it and now its showing me below error.

Error:

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!)

I already went through the urls like :Error creating bean with name and Singleton bean creation not allowed and https://github.com/spring-cloud/spring-cloud-netflix/issues/1064, but these suggestions are not clear.

The complete error trace:

2018-12-28 19:44:02.188  INFO 22184 --- [       Thread-6] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@dc9876b: startup date [Fri Dec 28 19:43:59 IST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@6e20b53a
2018-12-28 19:44:02.188  INFO 22184 --- [       Thread-6] o.s.c.n.e.s.EurekaServiceRegistry        : Unregistering application MYCLIENT with eureka with status DOWN
2018-12-28 19:44:02.188  WARN 22184 --- [       Thread-6] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1546006442188, current=DOWN, previous=UP]
2018-12-28 19:44:02.188  INFO 22184 --- [       Thread-6] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2018-12-28 19:44:02.190  INFO 22184 --- [       Thread-6] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-12-28 19:44:02.190  INFO 22184 --- [       Thread-6] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans
2018-12-28 19:44:02.192  INFO 22184 --- [       Thread-6] com.netflix.discovery.DiscoveryClient    : Shutting down DiscoveryClient ...
2018-12-28 19:44:02.194  WARN 22184 --- [       Thread-6] .s.c.a.CommonAnnotationBeanPostProcessor : 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!)

回答1:


You simply need to add the web dependency. I am not clear why with the addition of web dependencies works/solves this issue.



来源:https://stackoverflow.com/questions/53959982/error-creating-bean-with-name-eurekainstanceconfigbean-singleton-bean-creatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!