Field userMapper in com.sell.service.UserServiceImpl required a bean of type 'com.sell.mapper.UserMapper' that could not be found.
网络解释:大致的意思就是 mybatis的mapper扫描,被spring重写导致的问题
工程目录:
我的项目中是不能正常的autowired mapper,所以,我在
@SpringBootApplication @Slf4j @EnableConfigurationProperties @MapperScan("com.sell.mapper") // 因为扫描不到我的mapper,所以我在这里直接扫描此包,暂时没有找到其他的办法解决 public class SellApplication { public static void main(String[] args) { SpringApplication.run(SellApplication.class, args); log.info("customr spring boot started 666666...."); } }
如果有人有其他办法,请呼叫我....