Spring UnsatisfiedDependencyException: No Qualifying Bean of Type 'com.yh.king.mapper.auto.TbStudentMapper'
This error occurs when Spring cannot find a qualifying bean of type 'com.yh.king.mapper.auto.TbStudentMapper' to be autowired into the 'tbStudentServiceImpl' class. This could be due to a missing or incorrect configuration in the Spring context or the classpath.
To resolve this issue, you can try the following steps:
-
Check if the 'com.yh.king.mapper.auto.TbStudentMapper' class is present in the classpath and it has been properly configured as a Spring bean.
-
Ensure that the 'baseMapper' field in the 'tbStudentServiceImpl' class has the correct annotation (@Autowired) and is being injected with the proper bean.
-
Check if the package scanning is properly configured in the Spring context and that the 'com.yh.king.mapper.auto' package is being scanned for components.
-
Verify that there are no other conflicting beans of the same type being created in the Spring context that could be causing the issue.
By correcting these issues, you should be able to resolve the 'UnsatisfiedDependencyException' and successfully autowire the required bean into the 'tbStudentServiceImpl' class.
原文地址: https://www.cveoy.top/t/topic/lB51 著作权归作者所有。请勿转载和采集!