我正在使用Spring Data JPA來開發Spring MVC應用程序。我構建了一個JPA存儲庫。Spring數據jpa:沒有找到類型爲void的屬性flush
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
有沒有人有一個想法是怎麼回事?如果這有助於解決問題,我準備提供更多信息。提前致謝。
我認爲你想要初始化的bean有一些依賴,這些依賴用注入初始化,你需要在願望bean中禁用DI,或者檢查依賴關係,也許它們指向一個不存在的資源 – 2013-07-01 09:11:48