项目启动报错
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘injectionController’ defined in file […InjectionController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dictionaryServiceImpl’: Unsatisfied dependency expressed through field ‘baseMapper’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘…common.DictionaryMapper’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
截图
这是因为启动类上没有加mapperscan;扫描不到对应的类。
在启动类上加上 @MapperScan(“com…*.dao”);问题迎刃而解!