首先,贴下错误信息

当出现

The injection point has the following annotations:

- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type '****.SysUserMapper' in your configuration.

错误时,一般来说,都是注解无效。

引用其他大佬的文章及解决方案。一直在找相关的解决方法。

在这里记录下。

简单的说,这里就是,某某对象未能正常的实例化。

在此呢,尝试了多个方法。

1.在mapper/server中,没有添加对应的注解。导致无法实例化。

2.在Application(启动类)中,未添加@MapperScan注解。

3.pom.xml中,没有引入的mybatis

4.在配置文件中,添加mybatis的配置引用,却没有找到对应的mybatis对应的配置文件.(configLocation)

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐