
Consider defining a bean of type ‘com.course.server.mapper.TestMapper‘ in your configuration.
问题 Description: A component required a bean of type 'com.course.server.mapper.TestMapper' that could not be found. Action: Consider defining a bean of type 'com.course.server.mapper.TestMapper' in your configuration. 解决
我用了mybatis,在mapper层忘记加@Mapper注解了,加上后就可以了
其他情况:
使用@mapper后,不需要在spring配置中设置扫描地址,通过mapper.xml里面的namespace属性对应相关的mapper类,spring将动态的生成Bean后注入到ServiceImpl中
参考链接:@Mapper的作用
👁️ 阅读量:0
© 版权声明:本文《Consider defining a bean of type ‘com.course.server.mapper.TestMapper‘ in your configuration.》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686557147a291353.html。