caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying Bean of type [ So.dian.dev.device.interfaces.IDeviceInfoSV] is defined:expected single matching beans but found 2:deviceinfosvimpl, IDEVICEINFOSV At org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:1126) At org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1014) At org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$ Autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:545) ... more first of all, my engineering structure: Controller-->manager-->sv-->daoIt can be seen that the above exception is because the MyBatis automatic scanning to the SV layer interface, MyBatis will take this SV interface and mapper to match, and Mapper is configured in the DAO layer<mapper namespace="So.dian.dev.dao.device.IDeviceInfoDAO"> So of course I can't find it. The solution is to not let him sweep to the SV layer interface, using the @MapperScan ("So.dian.dev.dao") This annotation @SpringBootApplication@PropertySource({"variables.properties","Resource.local.properties"}) @MapperScan("So.dian.dev.dao") @EnableCachingpublic Class application extends springbootservletinitializer{
Spring Boot Integrated MyBatis error