No qualifying bean of type 'com.netflix.discovery.DiscoveryClient' available

ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘discoveryClient’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.netflix.discovery.DiscoveryClient’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

DiscoveryClient这个类有两个,导入的不一样会报错

发布了12 篇原创文章 · 获赞 2 · 访问量 192

猜你喜欢

转载自blog.csdn.net/qq_44766883/article/details/105438701
今日推荐