org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘loginController’: Unsatisfied dependency expressed through field ‘userService’;
解决办法:
检查启动类是否加上如下注解:
@MapperScan(basePackages = {“com.xx.xx.mapper”}, markerInterface = BaseMapper.class)
@ComponentScan(basePackages = {“com.xx.xx”})
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})

  1. 检查service的实现类上是否加上了注解 @Service

  2. 检查mapper接口类上面是否加了注解:@Mapper

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐