Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)

背景:使用mybatis-plus的自动代码生成后,启动项目时报该错误。

错误原因:项目的启动类上的注解@MapperScan的值路径错误,这个注解是让项目扫描dao包的,如果路径错误了,而你的service或者controller中注入了dao包中的对象,就会报dao报中的对象找不到,就是标题上的错误

@MapperScan(basePackages = "xxx.xxx")

你可能感兴趣的:(java开发,java)