在Src/com/topera/psm/config/目录下有applicationContext.xml
在WEB-INF目录下有web.xml,在web.xml中配置:<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:com/topera/psm/config/applicationContext.xml</param-value>
</context-param>
在启动Tomcat时报错,我是在IntelliJ IDEA工具下
[Unison] ERROR [main] ContextLoader.initWebApplicationContext(203) | Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException:IOException parsing XML document from class path resource [com/topera/psm/config/applicationContext.xml]; nested exceptionis java.io.FileNotFoundException: class path resource [com/topera/psm/config/applicationContext.xml] cannot be opened because it does not exist求求各位帮帮忙啦,我的配置应该没错,路径也没有错,但是启动Tomca 6 的时候却出现此错误,怎么办啊。。谢谢各位帮小弟一把了。

解决方案 »

  1.   

    试下:<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:com/topera/psm/config/applicationContext.xml</param-value>
    </context-param>
    没这样放过,一直都是放在WEB-INF下面的。
      

  2.   

    这样的的路径是找不到的,你可以采用根路径的下读取数据
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>