Error creating bean with name: Unsatisfied dependency expressed through field

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

猜你喜欢

转载自blog.csdn.net/qq_41358574/article/details/114122357