问答详情
源自:-

HomepageUserServiceTest无法通过测试

Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'eureka-client-homepage-course.FeignClientSpecification' defined in null: Cannot register bean definition [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'eureka-client-homepage-course.FeignClientSpecification': There is already [Generic bean: class [org.springframework.cloud.openfeign.FeignClientSpecification]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound.


已经删除掉了yml中的

feign:
#  hystrix:
#    enabled: true


提问者:sofia_ss 2020-07-08 20:59

个回答

  • sofia_ss
    2020-07-08 21:17:40

    spring:
      main:
        allow-bean-definition-overriding: true

    完美解决