Spring配置文件applicationcontext.xml默认路径为src/main/java,而不是直接放在src目录下。

工程demo如下:

1.java代码:

applicationcontext.xml cannot be opened because it does not exist错误解决

2.单元测试代码:

applicationcontext.xml cannot be opened because it does not exist错误解决

3. 目录结构:

applicationcontext.xml cannot be opened because it does not exist错误解决

4. 测试结果输出:

applicationcontext.xml cannot be opened because it does not exist错误解决

 

相关文章: