class path resource [spring/ApplicationContext-springmvc.xml] cannot be opened because it does not exist

配置如下:

<init-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>classpath:spring/ApplicationContext-springmvc.xml</param-value>
  </init-param>

原因是:IDE认为spring文件夹是在source下的,所以找不到

解决方案:

在classpath后面加个*

如下:

<init-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>classpath*:spring/ApplicationContext-springmvc.xml</param-value>
  </init-param>

posted @ 2017-08-12 11:16  赤子说  阅读(10695)  评论(2)    收藏  举报