问题
按网上的搜索,配置@Mapper
依然报错
Description:
Field tagMapper in com.example.demo.service.TagService required a bean of type 'com.example.demo.mapper.TagMapper' 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.example.demo.mapper.TagMapper' in your configuration.
Process finished with exit code 1
代码
相关信息
报错信息
controller和service
bean和mapper
一般得加MapperScann告诉容器去扫描哪个包,但是新版本的springboot已经做了默认配置,不加就是扫描启动类所在包以及子路径,代码地址在哪,给你看看