工程启动报ContetLoaderListener和RequestContextListener配置错误

阅读更多

今天启动工程,报

Error configuring application listener of class org.springframework.web.context.ContextLoaderListener

错误

在网上查找一番,得到几个解决方案:

1. 缺少spring-web.jar

2. web.xml文件中,listener标签要放在servlet标签前面

3. 在web.xml文件中,把


     org.springframework.web.context.ContextLoaderListener
    
    
     contextConfigLocation
     /WEB-INF/applicationContext.xml
    

放到最前面。

 

最终找到的原因:

listener标签放到context-param标签前面,并且把它们放到filter和servlet标签的前面,display-name标签的后面。

 

你可能感兴趣的:(工程启动报ContetLoaderListener和RequestContextListener配置错误)