启动一个Spring boot集成mybatis plus报错:
Error creating bean with name ‘examManageController’: Unsatisfied dependency expressed through field ‘examManageService’
描述:
启动类中有加注解mapperscan:
@MapperScan("com.naughty.userlogin02.dao")
@SpringBootApplication
public class Userlogin02Application {
public static void main(String[] args) {
SpringApplication.run(Userlogin02Application.class, args);
}
}
仔细看发现路径是com.naughty.userlogin02.dao,而自己的’examManageController’:并没有在这个包下面
于是转移了这个文件:
再启动:
虽然能启动了但是还有报错
mapper[com.naughty.userlogin02.dao.ExamManageMapper.findAll] is ignored, because it exists, maybe from xml file
另外要记得service中有加注解: