class path resource [applicationContext.xml] cannot be opened because it does not exist
来源:互联网 发布:屏蔽一段ip的js代码 编辑:程序博客网 时间:2024/05/21 06:00
maven创建web工程Spring配置文件找不到问题解决方案
使用maven创建web工程,将spring配置文件applicationContext.xml放在src/resource下,编译时提示class path resource [applicationContext.xml] cannot be opened because it does not exist错误。但是用mvn clean package命令编译时成功的。
web配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
发现是由于classpath不是指向resource路径,导致一直找不到文件。需要在classpath后面加个*,这样就解决问题了。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml</param-value>
</context-param>
阅读全文
0 0
- 关于class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- class path resource [spring.xml] cannot be opened because it does not exist
- Spring问题:class path resource [xxx.xml] cannot be opened because it does not exist
- class path resource [spring-mvc.xml] cannot be opened because it does not exist
- applicationContext.xml cannot be opened because it does not exist
- spring class path resource [jdbc.properties] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource ..cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist 解决方法
- eclipse项目报错怎么解决class path resource [beans.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- class path resource [spring.xml] cannot be opened because it does no exist;
- Spring问题:class path resource [org.spring/applicationContext.xml] cannot be opened because it does no
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not
- 基于Hadoop的数据压缩与解压缩实例
- Eloquent JavaScript 笔记 十: Modules
- UVa1368
- 一分钟了解“#include <iomanip>”
- 关于wireshark抓包的那点事儿
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- Android性能优化小结
- 调整数组顺序使奇数位于偶数前面(java版)
- Hibernate 配置键生成器
- 有关STL中的set容器的用法
- 利用FFmpeg玩转Android视频录制与压缩(二)(转载)
- Struts标签、Ognl表达式、el表达式、jstl标签库这四者之间的关系和各自作用
- 数据分析报告的框架——既要懂分析,也要会讲故事
- 登陆、注册