Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through

Error creating bean with name ‘**ServiceImpl’: Unsatisfied dependency expressed through field ‘Dao’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.example..Dao.***Dao’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

原因是mybatis是自己在pom.xml中添加的,而不是在创建springboot项目时勾选的,所以导致少了几个mybatis整合springboot的包。
1.解决方法1
勾选的应该包括下列几个包,pom.xml手动添加应该添加全面
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第1张图片
2.解决方法2:重新勾选mybatis依赖(推荐)
添加如下插件
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第2张图片
右键pom.xml
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第3张图片

刚刚安装的插件
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第4张图片

点击ok
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第5张图片
勾选mybatis
Springboot Error creating bean with name ‘****ServiceImpl‘: Unsatisfied dependency expressed through_第6张图片

你可能感兴趣的:(spring,boot,mybatis,java)