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包缺失或冲突;

posted @ 2021-12-15 16:22  Ryuuko-  阅读(543)  评论(0)    收藏  举报