启动一个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中有加注解:
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐