用MybtisPlus的代码生成器生成了impl,只在yml里配置了mapper的包路径,以及在主启动类上加了@MapperScan("mapper包路径"),启动,就报这个错,一直报这个错。
错误信息:
1.org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stuInfoScoreController': Unsatisfied dependency expressed through field 'stuInfoScoreService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stuInfoScoreServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jianglina.peixuncore.mapper.StuInfoScoreMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2.Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stuInfoScoreServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.jianglina.peixuncore.mapper.StuInfoScoreMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
3.NoSuchBeanDefinitionException: No qualifying bean of type 'com.peixuncore.mapper.StuInfoScoreMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
用过很多方法:
1.pom里的依赖版本问题 ——改的跟别人运行成功的版本一样也没用
2.在impl上写@Service("stuInfoScoreServiceImpl")或者@Service("stuInfoScoreService")——不好使
3.mapper路径——没问题
4.能在网上搜到的办法)——都不好使
困住我好几天了 我甚至连代码生成器都核对了好几遍 重写了好多遍还是这个问题 啥也不写就报这个错
在里面想注入个mapper也注入不进来
我不知道原因 也不知道咋解决,求指点。
MybatisPlus代码生成器生成的service实现类一直无法注入
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
7条回答 默认 最新
悬赏问题
- ¥15 chemex:docker安装chemex过程中遇到问题
- ¥15 关于遇到一个python,django,redis,uwsgi,nginx搭的一个企业微信修改AD密码的平台的问题!
- ¥15 读取parquet文件某一列的数据但是输出是整个列名和格式
- ¥15 机动目标 制导律建模问题
- ¥100 求Java socks 转发实现Demo
- ¥20 随身WiFi移动网络访问不了
- ¥50 RAD_XE11.3获取android11手机的IMEI码
- ¥15 linux的gcc命令报错
- ¥20 如何再GIS用海岸线建立缓冲区
- ¥15 codeblock遇到问题了,求帮助😭