1. 程式人生 > 其它 >LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext

LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext

今天在進行SSH(spring+springmvc+hibernate)框架整合的時候,一啟動專案,莫名地就出現了這麼一個錯誤,搞了大半天,還是報這些錯誤:
1:java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [
2:java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [
3:Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
然後就去找度娘了,根據度孃的查詢,總結到的所有的解決辦法有:
1. web.xml中沒有配置ContextLoaderListener監聽,
需要配置:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
2. 少 aopalliance.jar包,網上下載;
3. tomcat問題,關閉tomcat,clean,然後再重啟;
4. tomcat的JDK版本和工程的JDK版本不一致,spring版本不支援jdk的版本,檢查JDK配置;
5. applicationContext.xml 中 xml 格式不正確;
6. 引入的application的配置檔案有問題,可能是id或者property重複;
7. xml配置檔案的配置順序有問題;
8. spring版本過低,需要配置4.0以上的版本;
9. jar包缺失或衝突;