[Solved] Error creating bean with name rController‘: Unsatisfied dependency expressed through field

Problem Description:

@Override
Error creating bean with name 'ucenterMemberController': Unsatisfied dependency expressed through field 'ucenterMemberService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ucenterMemberServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.atguigu.educenter.mapper.UcenterMemberMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

Cause Analysis:
Noted one sentence of the error: No qualifying bean of type’com.atguigu.educenter.mapper.UcenterMemberMapper’ available: expected at least 1 bean which qualifies as autowire candidate. It means that the mapper is not scanned, and it needs to be added to the startup class. Scan the mapper’s comments

solution:

There was a mistake here, so the mapper was not scanned, so an error was reported.


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *