【SpringBoot_mybatis】启动报错Consider defining a bean of type ‘xxx.mapper.xxxMapper‘in your configuration

ゝ一世哀愁。 2024-03-24 17:33 196阅读 0赞

Problems

  1. 2023-04-10 12:20:49:611 ERROR 9932 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
  2. ***************************
  3. APPLICATION FAILED TO START
  4. ***************************
  5. Description:
  6. Field userMapper in com.xxx.service.impl.xxxServiceImpl required a bean of type 'com.xxx.mapper.xxxMapper' that could not be found.
  7. The injection point has the following annotations:
  8. - @org.springframework.beans.factory.annotation.Autowired(required=true)
  9. Action:
  10. Consider defining a bean of type 'com.xxx.mapper.xxxMapper' in your configuration.
  11. Process finished with exit code 1

Action:

Consider defining a bean of type ‘com.xxx.mapper.xxxMapper’ in your configuration.

Solution

注意springboot 与 mybatis 继承??需要在xxxMapper类上添加注解@Mapper

而不是使用的注解==@Repository==

注意一下吧,我不细心两次了呜呜~~~感谢阅读,点赞转发收藏再走吧嘻嘻~

发表评论

表情:
评论列表 (有 0 条评论,196人围观)

还没有评论,来说两句吧...

相关阅读