首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建名为“eurekaInstanceConfigBean”的bean时出错:在此工厂的单个程序被破坏时不允许单例bean创建

创建名为“eurekaInstanceConfigBean”的bean时出错:在此工厂的单个程序被破坏时不允许单例bean创建
EN

Stack Overflow用户
提问于 2018-12-28 14:22:17
回答 1查看 12.8K关注 0票数 0

这个问题是Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient的扩展。在我的windows机器上,JAVA_HOMEPATH都是不同的版本。我刚刚改正了它,现在它给我显示了下面的错误。

错误:

在名为“while edTarget.eurekaClient”的bean上调用破坏方法失败: org.springframework.beans.factory.BeanCreationNotAllowedException:错误创建名为“eurekaInstanceConfigBean”的bean :在此工厂的单节点被破坏时不允许单例bean创建(不要在破坏方法实现中从BeanFactory请求bean!)

我已经看过了urls,比如:Error creating bean with name and Singleton bean creation not allowedhttps://github.com/spring-cloud/spring-cloud-netflix/issues/1064,但是这些建议还不清楚。

完整的错误跟踪:

代码语言:javascript
复制
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!)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-01 12:26:58

您只需添加web依赖项即可。我不清楚为什么添加了、web、依赖/解决了这个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53959982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档