Description:
Field qrcodeMapper in com.xxx.springboot.controller.IppcTpUrlController required a bean of type ‘com.heiban.springboot.mapper.xxxMapper’ that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type ‘com.xxx.springboot.mapper.xxxMapper’ in your configuration.
解决方法:
- ServiceImpl加上@Service注释
- 在启动类加上注释@MapperScan(basePackages = “XXX.XXX.XXX.mapper”)
这篇博客讨论了一个常见的Spring Boot应用启动问题,即在尝试注入Mapper接口时出现bean缺失的错误。解决方案包括在Service实现类上添加@Service注解,并在启动类中使用@MapperScan指定Mapper接口所在的包路径。这有助于确保Spring Boot能够正确扫描并实例化所需的Mapper beans。
1281

被折叠的 条评论
为什么被折叠?



