背景:微服务之间使用Feign调用,当微服务B依赖微服务A后,启动报错Field xxx in xxx required a bean of type xxx that could not be found

使用@SpringCloudApplication+@ComponentScan或@SpringBootApplication+@EnableEurekaClient注解均会报错(包没扫描到)

解决办法:
使用@EnableFeignClients(basePackages={"com.xxx.xxx"})
方案一:(SpringBootApplication配置scanBasePackages = "xxxx")自行加上

@SpringBootApplication
@EnableFeignClients(basePackages={"com.xxx.xxx","com.xx.xxx"})

方案二:

@SpringCloudApplication
@ComponentScan(basePackages = {"com.xxx.lib","com.xxx.xxx","com.xxx.xxxx"})
@EnableFeignClients(basePackages = {"com.xxx.xxx","com.xx.xxx"})

Field xxx in xxx required a bean of type xxx that could not be found相关推荐

  1. SpringBoot报错Field userService in XXTestController required a bean of type 'XX' that could not be...

    运行SpringBoot项目报错Field userService in XXXTestController required a bean of type 'XXX' that could not ...

  2. SpringBootTest遇到的问题----Field userMapper in xxx.service.UserService required a bean of type

    在单元测试中遇到:Field userMapper in xxx.service.UserService required a bean of type 在具体的测试方法中使用了service中的方法 ...

  3. springboot使用junit单元测试是发生报错 Field taskUtils in com.xxx.xxx.xxxx.xxx required a bean of type 'xxx.xxx.

    使用junit单元测试mybatis时发生如下错误 Error starting ApplicationContext. To display the conditions report re-run ...

  4. springboot踩坑日记——Field xxx.xxx.xxx required a bean of type 'xxx.xxx.xxx' that could not be found

    使用feign时报创建的feign接口找不到 Field xxx.xxx.xxx required a bean of type 'xxx.xxx.xxx' that could not be fou ...

  5. 使用Feign服务远程调用项目启动时报错:Field xxx in xxx required a bean of type xxx that could not be found.

    报错: *************************** APPLICATION FAILED TO START ***************************Description:F ...

  6. Field xxxMapper in com.xxx.service.UserService required a bean of type ....

    问题 启动springboot项目时出现了 Field xxxMapper in xxx.service.UserService required a bean of type 'cxxx.mappe ...

  7. A component required a bean of type ‘XXX‘ that could not be found 解决办法

    springboot应用启动的时候,bean的加载扫描失败,错误信息如下A component required a bean of type 'XXX' that could not be foun ...

  8. Parameter 1 of constructor in xxx required a bean of type xxx‘ that could not be found.已经解决

    使用Mybatis Plus 时遇到问题Parameter 1 of constructor in xxx required a bean of type xxx' that could not be ...

  9. 关于解决required a bean of type ‘XXX’ that could not be found.的问题

    解决required a bean of type 'XXX' that could not be found.的问题 本人java菜鸟一枚,最近在新做的springboot里面关于无法注入Bean的 ...

  10. mybatis Field xxxMapper in xxxx required a bean of type 'XXXMapper' that could not be found.

    错误如下: 2017-05-11 16:15:32.410 [main] INFO o.a.catalina.core.StandardService - Stopping service Tomca ...

最新文章

  1. web开发过程中经常用到的一些公共方法及操作
  2. mybatis入门(六)----高级映射(一对一,一对多,多对多)
  3. day10 in india
  4. 高性能服务器开发之C++定时器
  5. JavaWeb——AOP
  6. 业务中台--如何设计企业级权限管理系统
  7. 泰勒展开-常用优化实例
  8. android锁屏了怎么办,安卓手机被恶意锁屏该怎么办
  9. Web服务器和http请求
  10. win10彻底禁用自动更新,win10怎样彻底关闭自动更新,永久关闭win10自动更新,win10更新助手...
  11. Android添加UserAgent
  12. 【金融项目】尚融宝项目(八)
  13. 顶级猎头的十大成功特征
  14. 一级计算机考上安装电脑桌面,仅花190元 轻松给本本升级触摸屏(多图)
  15. 对k8s的背景知识汇总
  16. 如何登录Tencent QQ
  17. 数论出题组比赛用题:签到题(待完善)
  18. 推荐六种查看Android系统源码的网址
  19. 阿里云——轻量应用服务器
  20. 2022年十大除甲醛净化器排名

热门文章

  1. 因果推断15--GRFlift: GMV约束下多重处理的提升模型
  2. 算法第四天|LeetCode24、LeetCode19、LeetCode面试题 02.07、LeetCode142
  3. 深度学习之注意力机制attention
  4. Spotfire调试经验——分组累计值的动态计算(Dynamic calculation of grouped accumulated value in Spotfire)
  5. [互联网]2018年互联网套路简史
  6. 微信一键检测单删好友 帮你搞来了!
  7. 18_数组的定义和访问
  8. Unity 清理掉项目中垃圾文件——UnityAssetCleaner
  9. 计算机病毒有什么类型,计算机病毒有哪些类型? - 问答库
  10. windows 安装cx_Oracle