【发布时间】:2018-12-25 09:41:36
【问题描述】:
我尝试按照本教程创建custom repository:https://www.baeldung.com/spring-data-jpa-method-in-all-repositories
我的应用构建失败并出现错误:
NoSuchBeanDefinitionException: No qualifying bean of type 'com.example.demo.dao.ExtendedStudentRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
我的完整源代码: https://github.com/sesong11/springjpa-custom-repo
有很多类似的问题,但没有一个适合我。可能是当前版本 2.1.1 的 Spring 问题,或者我错过了一些配置。
【问题讨论】:
-
您能否确认您已经安装了
java11并且您的环境使用它来运行代码? -
是的,我愿意。我的其他程序也使用相同的环境设置
-
我使用 OpenJDK 11
标签: java spring spring-boot spring-data-jpa spring-repositories