• 首页
  • 栏目
  • CRM
  • Field xxxMapper in com.xxxx.service.impl.xxxServiceImpl required a bean of type ‘com.xxx.mapper.xxx

Field xxxMapper in com.xxxx.service.impl.xxxServiceImpl required a bean of type ‘com.xxx.mapper.xxx

  • 2021-12-07
  • Admin

1、报错信息

Field userMapper in com.xxx.xxx.service.impl.UserServiceImpl required a bean of type 'com.xxx.xxx.mapper.UserMapper' that could not be found.

2、原因

没有把UserMapper托管到Spring容器

3、解决办法

第一种:

在UserMapper上面加上@Mapper的注解

第二种:

在该项目的启动类上面加上@MapperScan("这里写放置mapper的包名") 

 

原文:https://blog.csdn.net/m0_64284147/article/details/121765085

联系站长

QQ:769220720