[Solved] Springboot error: Could Not Found xxmapper

springboot error: could not found xxmapper

Error Messages:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.xxxx.server.mapper.AdminMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.xxxx.server.mapper.AdminMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Unsatisfied dependency expressed through field baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type com.xxxx.server.mapper.AdminMapper available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 

 

Solution: Add mapper package scan to springboot startup class

@MapperScan("com.xxxx.server.mapper")

Read More: