Tag Archives: @ SpringBootApplication error

[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.

Reason for error in idea @ springbootapplication [solved]

IDEA has a built-in Maven environment, which is used by default to address project dependencies. After creating a new project, the pom.xml file and the project name.iml file are generated in the project path. After creating a new project, IDEA does not automatically refresh the Maven dependencies. Maven configuration should be refreshed when @springbootapplication file is automatically generated in MyspringbootApplication:
Open File –> in turn; settings–> Build–> Maven,

Select the “Import Maven projects Automatically” option to refresh Maven