这个问题是Working With Eureka Clients Programmatically issue - Completed shut down of DiscoveryClient的扩展。在我的windows机器上,JAVA_HOME和PATH都是不同的版本。我刚刚改正了它,现在它给我显示了下面的错误。
错误:
在名为“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 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!)发布于 2019-01-01 12:26:58
您只需添加web依赖项即可。我不清楚为什么添加了、web、依赖/解决了这个问题。
https://stackoverflow.com/questions/53959982
复制相似问题