我正在使用 Spring Data JPA 开发 Spring MVC 应用程序。我建立了一个 JPA 存储库。
public interface AccessReportRepository extends JpaRepository<AccessReport, Long> {
}
我还在我的项目中使用 Spring Data Mongo 和 JPA。
当我运行该项目时,我收到此错误。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lastDateController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.innolabmm.software.mongotest.springrest.ReadingService com.innolabmm.software.mongotest.springrest.LastDateController.readingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'readingService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.innolabmm.software.mongotest.springrest.AccessReportRepository com.innolabmm.software.mongotest.springrest.ReadingService.reportRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accessReportRepository': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property flush found for type void
有谁知道发生了什么?如果这有助于解决问题,我准备提供更多信息。提前致谢。