在springBoot和Myatis 整合中出现springBoot无法启动 并且报以下错误
Description:
Field userMapper in cn.lijun.controller.UserController required a bean of type ‘cn.lijun.mapper.UserMapper‘ that could not be found.
Action:
Consider defining a bean of type ‘cn.lijun.mapper.UserMapper‘ in your configuration.
解决方法是:
在启动类上添加注解
@MapperScan(basePackages = "cn.lijun.mapper")
原文地址:https://www.cnblogs.com/lijun6/p/11398453.html
时间: 2024-10-06 05:03:12