在使用mapstruct的时候,遇到了如题的报错。

问题很简单,是说找不到这个bean,没有注入spring容器,但是我在mapstruct接口上已经有了如下注解,却报错了

@Mapper
@Component

解决办法就是Mapper上要加属性,指明加入spring才行。而这时,已经完成了注入spring的功能,但是如果只有这个@Mapper(componentModel = "spring"),在注入Converter的时候会编译警告说这个没注入进来,其实已经注进来了,不想看到这个警告就加一个@Component就可以。

@Component
@Mapper(componentModel = "spring")

【踩坑专栏】required a bean of type ‘xxx.UserConverter‘ that could not be found相关推荐

  1. 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 ...

  2. 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 ...

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

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

  4. 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 ...

  5. 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 ...

  6. 关于解决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的 ...

  7. 解决:Parameter 0 of constructor in xxx required a bean of type ‘xxx‘ that could not be found.

    运行报错: Parameter 0 of constructor in com.xxx.Crawler required a bean of type 'java.lang.String' that ...

  8. 解决:Parameter 0 of constructor in XXX required a bean of type ‘XXX‘ that could not be found

    解决:Parameter 0 of constructor in com.mise.smart.entity.HrmNoticeEntity required a bean of type 'java ...

  9. springboot启动失败 required a bean of type ‘XXX‘ not be found

    改造老项目时出现注入失败问题 Description: Field httpclient in com.cn.XXX.user.business.impl.UserBusinessImpl requi ...

最新文章

  1. Oracle CDC (Change Data Capture)更新数据捕获——概述
  2. 在Windows Server 2012 R2中搭建SQL Server 2012故障转移集群
  3. 【渝粤教育】国家开放大学2018年秋季 0695-21T (1)农业企业经营管理 参考试题
  4. HYSBZ - 1101——莫比乌斯反演
  5. Mybatis(6)CURD增删改查操作
  6. struts2 OGNL表达式
  7. How to get the android resolution
  8. echarts的pie图中,各区块颜色的调整
  9. linux系统虚拟机gcc下载,Linux(Ubuntu)虚拟机安装GCC编译器
  10. 关于:在 Office 2021 中自定义模板
  11. 32位计算机怎么安装ps,我可以在64位系统上安装32位Photoshop吗?
  12. safari遮罩无效
  13. 详解深度学习中的梯度消失、爆炸原因及其解决方法
  14. 我的web前端工作日记2------web前端工作的一天
  15. 英剧推荐【IT狂人】
  16. gii无法访问 yii2_YII2框架访问gii、debug页面404的错误解决方法
  17. Windows安装mysql及图形化界面navicat
  18. 关于HOOK,如何通过钩子截获指定窗口的所有消息
  19. Firefox 的用户脚本管理器 greasemonkey 的使用一例
  20. STM32F0 ADC学习

热门文章

  1. 白月黑羽教python之selenium:课后练习作业二
  2. 芋道项目搭建注意事项
  3. 记录学习 python-机器学习 02
  4. 电力电子技术->整流电路
  5. 苹果平板哪款电容笔好用?超好用的苹果平板电容笔推荐
  6. 一个简单有效的手写识别引擎
  7. vue移动端适配—手动rem适配
  8. 大数据之hadoop
  9. 20210428# 咕泡RabbitMQ文档
  10. PHP 导出excel表格的3种方法