今天启动工程,报
Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
错误
在网上查找一番,得到几个解决方案:
1. 缺少spring-web.jar
2. web.xml文件中,listener标签要放在servlet标签前面
3. 在web.xml文件中,把
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
放到最前面。
最终找到的原因:
listener标签放到context-param标签前面,并且把它们放到filter和servlet标签的前面,display-name标签的后面。