org.springframework.beans.factory.BeanCreationNotAllowedException:Error

服务注册到Eureka时报错:

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


错误位置:大概是在销毁scopedTarget.eurekaClient这个的时候失败,抛出BeanCreationNotAllowedException创建bean的异常。

错误原因:不能在销毁方法实现中向BeanFactory请求eurekaInstanceConfigBean

解决方法:

添加依赖

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

完美解决。

你可能感兴趣的:(SpringBoot,spring,cloud)