解决Singleton bean creation not allowed while singletons of this factory are in destruction (Do not re

环境:springcloud F版本+maven工程

注册中心正常,创建普通的client项目,向注册中心注册,启动项目失败。

解决控制台警告错误信息:

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

 

首先检查pom文件是否有:


  org.springframework.boot
  spring-boot-starter-web


    org.springframework.cloud
    spring-cloud-starter-netflix-eureka-client

然后检查启动类是否添加了

@EnableDiscoveryClient

注解。

你可能感兴趣的:(springCloud)