使用@Mapping会报出如下错误

当出现

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.

错误时,一般来说,都是注解无效。
而这里无效的原因,有可能为mybatis和mybatis-spring的版本不够高

因为  Mapper来自mybatis-3.5.3.jar包       MapperScan来自mybatis-spring-2.0.3.jar包

还有可能@Mapping引入不到为@MappingScan的原因

 

 

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐