A component required a bean of type 'com.example...' that could not be found解决办法

工程启动报错
A component required a bean of type ‘com.example…’ that could not be found
A component required a bean of type 'com.example...' that could not be found解决办法_第1张图片

解决办法一:
1、再启动类添加mapper包扫描注解即可
@MapperScan(“com.example.firstspringboot.dao”)
A component required a bean of type 'com.example...' that could not be found解决办法_第2张图片

解决办法二:
在每个mapper接口上添加@mapper注解
A component required a bean of type 'com.example...' that could not be found解决办法_第3张图片

你可能感兴趣的:(Spring,Boot)