springboot報錯:java.lang.IllegalStateException: Failed to load ApplicationContext

這個錯誤,整整搞了5天,5天。
最後查到問題:依賴包錯誤。我以爲是代碼的錯誤呢。
在這裏插入圖片描述
還報瞭如下錯誤:(這裏只截取部分的重要錯誤)

java.lang.IllegalStateException: Failed to load ApplicationContext

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/io/STAXEventReader

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productCategoryRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract com.ord.dataobject.ProductCategory com.ord.repository.ProductCategoryRepository.findOne(java.lang.Integer)! No property findOne found for type ProductCategory!

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'categoryServiceImpl': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productCategoryRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract com.ord.dataobject.ProductCategory com.ord.repository.ProductCategoryRepository.findOne(java.lang.Integer)! No property findOne found for type ProductCategory!

這個問題我搞了5天,最後終於發現的問題。

依賴包錯誤。
在這裏插入圖片描述
依賴包錯誤很嚴重,我這個是在test測試的時候就報錯了,要是在實際開發過程當中就很嚴重了。

因爲我這個是在測試的時候就報錯了,而這個錯誤就是依賴包導入錯誤。

所以,這個問題就是依賴包錯誤。你只要仔細回想回想自己的依賴包導入了哪個,應該導入哪個,哪個沒導入,都要好好仔細的找找。
這個錯誤沒有固定的解決辦法。
如果在依賴包找不到錯誤的話,實在找不到了也可以加我QQ3506346737

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章