class path resource [applicationContext.xml] cannot be opened because it does not exist

使用maven创建web工程,将Spring配置文件applicationContext.xml放在src/resource下,用eclipse编译时提示class path resource [applicationContext.xml] cannot be opened because it does not exist错误

发现是由于classpath不是指向resource路径,导致一直找不到文件。需要在classpath后面加个*,这样就解决问题了。

<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext.xml</param-value> </context-param>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念