创建名为“eurekaInstanceConfigBean”的 bean 时出错:在销毁此工厂的单例时不允许创建单例 bean

到_A

这个问题是使用 Eureka Clients Programmatically 问题的扩展- 已完成关闭 DiscoveryClient在我的 Windows 机器上JAVA_HOMEPATH两个版本都不同。我刚刚更正了它,现在它向我显示以下错误。

错误:

在名为“scopedTarget.eurekaClient”的 bean 上调用 destroy 方法失败:org.springframework.beans.factory.BeanCreationNotAllowedException:创建名为“eurekaInstanceConfigBean”的 bean 时出错:在销毁此工厂的单例时不允许创建单例 bean(不要在销毁方法实现中从 BeanFactory 请求一个 bean!)

我已经浏览过如下网址:Error created bean with name and Singleton bean creation not allowed and https://github.com/spring-cloud/spring-cloud-netflix/issues/1064,但这些建议尚不清楚。

完整的错误跟踪:

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

您只需要添加Web依赖项。我不清楚为什么添加web依赖项可以解决这个问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

Related 相关文章

热门标签

归档