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.
2. Solution 2: Re-check mybatis dependencies (recommended)
and add the following plug-ins.
Right-click pom.xml
The plugin just installed
Click ok
to check mybatis