mave配置之spring.xml is not exeist
来源:互联网 发布:C语言new 编辑:程序博客网 时间:2024/05/13 03:48
错误信息:class path resource [spring.xml] cannot be opened because it does not exist
配置文件的位置:\src\main\resources\spring.xml
使用maven install 编译通过,但是启动tomcat的时候还是报错。原因是该配置文件没有编译到容器中去。
web.xml 中配置:
<!-- spring配置文件位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
解决办法:
由于classpath不是指向resource路径,导致一直找不到文件。需要在classpath后面加个*,这样就解决问题了。
所以将web.xml中的代码改为:
<!-- spring配置文件位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring.xml</param-value>
</context-param>
重启编译启动,成功启动项目!
0 0
- mave配置之spring.xml is not exeist
- Mave+Spring+Hibernate SSH配置
- mave-用maven创建基础的struts2+spring+hibernate之二spring配置
- mave-用maven创建基础的struts2+spring+hibernate之三hibernate配置
- mave项目报错:web.xml is missing and <failOnMissingWebXml> is set to true
- IDEA编译器之 mave web项目配置tomcat
- mave安装与配置
- Spring AOP之XML配置
- Spring之config.xml配置
- Spring IOC之XML配置
- Spring项目配置之web.xml配置
- spring,hiberante之*** is not valid without active transaction
- spring,hiberante之*** is not valid without active transaction
- spring,hiberante之*** is not valid without active transaction
- spring,hiberante之*** is not valid without active transaction
- Spring配置dubbo时报错: does not support XML
- mave
- spring+hibernate之applicationContext.xml配置
- leetcode 17. Letter Combinations of a Phone Number
- nmake chk一切正常 free会产生错误 error C2220: warning treated as error - no 'object' file generated
- Matlab画图函数与参数
- C++学习(九)——内存模型和名称
- Sublime Text 3 常用插件
- mave配置之spring.xml is not exeist
- 防止 print 自动换行
- Java List转Map
- Httpclient请求数据
- 九度OJ_还是畅通工程_1017
- java 从网络Url中下载文件
- Java集合框架(JCF)
- 断点调试
- 阿里云centOS搭建wordpress步骤