spring boot 的 userRepository无法注入的问题

No qualifying bean of type 'xxx.xxx.xxx' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

在启动项上加上

@EnableJpaRepositories(basePackages = "com.ssm.repository")
扫描到指定的包

猜你喜欢

转载自www.cnblogs.com/oldzhang1222/p/9447893.html