问题描述
在微服务开发中遇到了一个服务已经下线很久,但 eureka 中却显示服务还在导致服务启动注册失败的问题,启动失败日志如下:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'eurekaAutoServiceRegistration': 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!)
根本原因
eureka 未发现服务提供者已经下线
问题解决
手动强制下线服务
curl -v -X DELETE 192.168.56.138:28761/eureka/apps/MY-CONSTRUCTION/101.10.10.17:28114