Mybatis报错:required a bean of type 'com.**.***Mapper' that could not be found.

2020-05-22T15:36:00

错误日志描述

Description:
Field eduTeacherMapper in com.greatdata.provider.service.EduTeacherServiceImpl required a bean of type 'com.greatdata.provider.mapper.EduTeacherMapper' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.greatdata.provider.mapper.EduTeacherMapper' in your configuration.

解决方法,在启动类上加上扫描包
@MapperScan(basePackages = "com.songzixian.mapper")

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »