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)}

The reason is that mybatis is added in pom.xml by itself, rather than checked when creating the springboot project, so a few mybatis integrated springboot packages are missing.
1. Solution 1
: The following packages should be checked, and pom.xml should be added manually.
insert image description here
2. Solution 2: Re-check mybatis dependencies (recommended)
and add the following plug-ins.
insert image description here
Right-click pom.xml
insert image description here

The plugin just installed
insert image description here

Click ok
insert image description here
to check mybatis
insert image description here

Guess you like

Origin blog.csdn.net/weixin_46463341/article/details/125583091