这个问题是Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient的扩展名。在我的Windows机器JAVA_HOME
和PATH
上,两个版本有所不同。我只是更正了它,现在它向我显示了下面的错误。
错误:
对名称为'scopedTarget.eurekaClient'的bean的销毁方法调用失败:org.springframework.beans.factory.BeanCreationNotAllowedException:创建名称为'eurekaInstanceConfigBean'的bean的错误:在销毁该工厂的单例时不允许创建单例bean (不要在destroy方法的实现中向BeanFactory请求Bean!)
我已经浏览过诸如:Error creating bean with name and Singleton bean creation not allowed和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!)
答案 0 :(得分:1)
您只需要添加 web 依赖项。我不清楚为什么添加 web 依赖项可以解决/解决此问题。