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

来源:互联网 发布:淘宝翻新机 编辑:程序博客网 时间:2024/05/17 06:56

今天在进行spring3.1配置的时候,

遇到了Error configuring application listener of class org.springframework.web.context.ContextLoaderListener的错误 ,

按照网上的方法试了好多种,

最后发现是无法找到applicationContext.xml文件造成的。

解决办法:
        首先,必须保证所有必须的jar包都已导入到/WEB-INF/lib文件夹中。
        其次,在web.xml中加入
        <context-param>
              <param-name>contextConfigLocation</param-name>
              <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value>
        </context-param>
        <listener>
              <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

之前我也配置了这个参数,但是可能是<param-value>……</param-value>中内容不对,所以仍旧无法解决,按照上述进行配置后,错误就消失啦·~~~