@Autowired recently encountered problems using springboot failure to integrate mybatis-plus, baffled! ! !
Project is structured as follows:
Start class LsTestApplication:
Controller UserController:
Implementation class UserServiceImpl:
UserMapper:
After starting up the error, the error message is as follows:
2019-08-23 17:16:16.457 WARN 8528 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.sand.demo.mapper.UserMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Guess may be a component not to scan, but use development tools to view IDEA is there, but the path starts feeling like too much to complain problem