请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

进行用户模块的单元测试时失败

老师,在5-6节的最后单元测试时,我一直无法通过单元测试,具体报错信息为:

Error creating bean with name 'userFileService': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.imooc.pan.server.modules.file.mappers.file.RPanUserFileMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

看报错信息感觉是userFileService这个类没有创建,但是我回去看代码也不知道哪里出现了问题,之前MP生成的实体类中也是没有驼峰命名,然后我手动改成了驼峰命名了,mapper.xml文件也把对应字段的名称改成驼峰命名了,不知道怎样才能解决这个报错,求指教。

https://img1.sycdn.imooc.com//szimg/64e4c4c2094de5ce19140998.jpg

https://img1.sycdn.imooc.com//szimg/64e4c4f409a6392d19201000.jpg

正在回答 回答被采纳积分+3

1回答

提问者 慕沐6599965 2023-08-22 22:47:06

已解决,@MapperScan的包名写错了,之前跟着老师写了mappers包,然后@MapperScan里面写成了mapper。。

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号