Spring Boot 当我使用带有h2数据库的存储库时,发生Sping Boot 错误[已关闭]

5lhxktic  于 2023-03-02  发布在  Spring
关注(0)|答案(1)|浏览(142)

编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
3天前关闭。
Improve this question

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentController': Unsatisfied dependency expressed through field 'studentService': Error creating bean with name 'studentService': Unsatisfied dependency expressed through field 'studentRepository': Error creating bean with name 'studentRepository' defined in com.example.demo.repository.StudentRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration:...

我在网上尝试了很多解决方案,我遵循了很多教程中的所有说明,但我总是得到这个错误。当我评论仓库界面时,它消失了。我遵循这个https://www.javatpoint.com/spring-boot-h2-database,我把所有依赖项,如h2和jps和web

xyhw6mcr

xyhw6mcr1#

尝试在存储库接口上添加@Repository注解,spring Boot 无法将StudentRepository识别为bean

相关问题