学习spring-cloud报了一个错误:Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found.
pom依赖为
<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
查了一下原因发现时导入包错误:@Resource
private DiscoveryClient discoveryClient;有两个导入包:
import org.springframework.cloud.client.discovery.DiscoveryClient;
com.netflix.discovery;导入时应该导入第一个

DiscoveryClient报错:相关推荐

  1. idea在自动注入DiscoveryClient的时候报错

    解决方法: 一.导错了包 DiscoveryClient对应有两个包: org.springframework.cloud.client.discovery.DiscoveryClient; com. ...

  2. spring cloudAlibaba gateway网关报错,显示无法找到注册中心注册自己。

    spring cloudAlibaba gateway网关报错,显示无法找到注册中心注册自己. 1.错误提示 2020-12-29 11:10:18.521 WARN 232 --- [freshEx ...

  3. eureka客户端报错:was unable to send heartbeat Cannot execute request on any known server

    最近新学spring-cloud,客户端注册的时候报错如下: 2022-03-30 20:25:14.141 ERROR 12208 - [tbeatExecutor-0] c.n.d.s.t.d.R ...

  4. Spring Boot-yaml格式,eureka客户端配置default-zone报错问题

    本文为joshua317原创文章,转载请注明:转载自joshua317博客 Spring Boot-yaml格式,eureka客户端配置default-zone报错问题 - joshua317的博客 ...

  5. 继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错? springboot 两种方式稳定解决跨域问题

    继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错???springboot 两种方式稳定解决跨域问题! 之前我写了一篇文章,来解决CORS报错 ...

  6. Access to XMLHttpRequest at file from origin ‘null‘ has been blocked by CORS policy谷歌浏览器本地打开项目js文件报错

    Access to XMLHttpRequest at 'file:///xxxxx/PQ.BaseInfo.proto' from origin 'null' has been blocked by ...

  7. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  8. docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name

    docker 报错: Error response from daemon: Cannot restart container hello: driver failed programming ext ...

  9. mybatis查询报错:com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string

    mybatis查询报错: com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from strin ...

最新文章

  1. Apriltag可用图片:TAG16H5
  2. Qt creator自定义编译运行步骤
  3. Java 改变cmd颜色_9 个小技巧让你的 if else 看起来更优雅!
  4. C# 数据库系统中使用GDI+绘制柱状图
  5. 剖析数据库中重要而又常被曲解的概念
  6. 第十一届 蓝桥杯 单片机设计与开发项目 省赛 程序设计试题及源码
  7. 【SpringBoot 2】(五)自动配置简析源码 开发中小技巧
  8. JavaWeb之tomcat安装、配置与使用(一)
  9. SQL 年龄段 品牌分类 分组统计
  10. 软件工程的未来发展趋势[转载]
  11. python3多进程爬虫(第二卷)
  12. 安全验证框架使用笔记001---Shiro简介
  13. MySQL 存储引擎和锁
  14. mysql更新一条语句_讲讲一条MySQL更新语句是怎么执行的?
  15. 五句话搞定JavaScript作用域
  16. 每日自增字段mysql_2020-11-05 触发器实现mysql每日自增字段
  17. ansible自动运维
  18. windows 10 账号密码策略及规则
  19. linux 离线迅雷下载软件,Linux 迅雷离线客户端!!!!!!!!!!!!
  20. [金工实习报告]金工实习基本方法,车工/焊接/钳工/铣工/铸造/安全生产/3D打印等

热门文章

  1. c# http模拟post请求,解决参数很大的情况
  2. C语言字符串string.h详解
  3. VUE 保留 四位小数
  4. 雨流法工具箱rainflow进行疲劳分析教程(含雨流法rainflow工具箱下载及安装教程)
  5. 算法的“有毒泡泡”,当真可以戒掉吗?
  6. 关联规则--Apriori算法
  7. 小米6最好用的系统版本
  8. MQ系列传感器怎么用,mq2传感器引脚怎么接
  9. 如何将所有电子邮件地址合并到一个Outlook.com收件箱中
  10. 捷的軟體開發流程(CMMI)