0
点赞
收藏
分享

微信扫一扫

【JPA】使用@Repository报错,找不到Bean

西特张 2022-07-28 阅读 76


一、问题描述

使用@Repository报错

Description:

Field userWriteRepo in com.marion.study.service.UserService required a bean of type 'com.marion.study.repo.write.UserWriteRepo' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.marion.study.repo.write.UserWriteRepo' in your configuration.

二、问题定位

@Primary
@EnableJpaRepositories(basePackages = "com.marion.study.repo.master",
entityManagerFactoryRef = "entityManagerFactory",
transactionManagerRef = "transactionManager")
public static class writeConfiguration {
}

扫描basePackages不存在,应该是com.marion.study.repo.write

举报

相关推荐

0 条评论