java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext


spring的項目中有時候會報錯:java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

原因:spring初始化bean對象出錯;1)xml的bean的id 有重復;

                                              2)如果是注解配置:可能是注解的名稱有重復:

只需要將重復的bean 的id和重復的注解改了就行了;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM