关于applicationContext.xml cannot be opened because it does not exist的解决
来源:互联网 发布:外国人感叹淘宝 编辑:程序博客网 时间:2024/05/16 09:29
ApplicationContext 对象的初始化的时候,根据配置文件的位置,找到配置文件,然后初始化,
但是吧,老是出错,总是分不清用哪个去初始化。
加上file:把路径写全(用这个方法xml可以放任意地方)
ApplicationContext ctx = new ClassPathXmlApplicationContext("file:E:/fusion/intellij_work/TrunkNew/sss.xml");
2.FileSystemXmlApplicationContext
估计相对的是项目的目录位置
ApplicationContext ctx = new FileSystemXmlApplicationContext("sss.xml");//这个时候sss.xml是在项目的根目录下
ApplicationContext ctx = new FileSystemXmlApplicationContext("src/sss.xml");//这个时候sss.xml是在项目的根目录下的src文件夹下
但是吧,老是出错,总是分不清用哪个去初始化。
下面简单总结下:
加上file:把路径写全(用这个方法xml可以放任意地方)
ApplicationContext ctx = new ClassPathXmlApplicationContext("file:E:/fusion/intellij_work/TrunkNew/sss.xml");
2.FileSystemXmlApplicationContext
估计相对的是项目的目录位置
ApplicationContext ctx = new FileSystemXmlApplicationContext("sss.xml");//这个时候sss.xml是在项目的根目录下
ApplicationContext ctx = new FileSystemXmlApplicationContext("src/sss.xml");//这个时候sss.xml是在项目的根目录下的src文件夹下
0 0
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- applicationContext.xml cannot be opened because it does not exist
- 关于class path resource [applicationContext.xml] cannot be opened because it does not exist
- 创建spring的IOC容器时[ApplicationContext.xml] cannot be opened because it does not exist
- [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
- cannot be opened because it does not exist
- eclipse项目报错怎么解决class path resource [beans.xml] cannot be opened because it does not exist
- webservice [META-INF/xfire/services.xml] cannot be opened because it does not exist
- webservice [META-INF/xfire/services.xml] cannot be opened because it does not exist
- [Tomcat] classpath resource [hbm.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
- 正则表达式1---findall获取tasklist进程信息并存储近文档
- 使用人类史上最好的编辑器:Vim
- 怎么在for里面再次循环!
- 微信小程序教程(1)
- 网络技术—Internet技术基础
- 关于applicationContext.xml cannot be opened because it does not exist的解决
- thymeleaf中的th:each用法
- java List的使用
- java中split()特殊符号"." "|" "*" "\" "]"
- 布局xml文件中的include标签
- 最小生成树的prim算法
- thymeleaf中的条件判断用法
- Mac上安装MySQL记要
- yii2中,视图中使用autocomplete在传值和显示在两个不同的表的时候,进行搜索查询的方法