.xml 文件在 intellij 社区版中找不到

问题描述 投票:0回答:1

intellij 社区版中的错误:{ java.io.FileNotFoundException: 类路径资源 [config.xml] 无法打开,因为它不存在 } ... 但是当我尝试删除此文件时,它说删除找到的引用可能不安全如图所示的代码 我的代码是:ApplicationContext context = new ClassPathXmlApplicationContext("config.xml"); 我已经尝试了每条可能的路径,例如来自当前根的路径、来自源根的路径,但找不到解决方案。[在此处输入图像描述enter image description here](https://i.stack.imgur.com/Zez0l.png)

尝试了所有可能的路径,当前根的路径,源根的路径但找不到解决方案。每次它给出 filenotfound 异常。

制作资源文件后 updated

errors in updated(still no change)

updated code

xml spring path configuration filenotfoundexception
1个回答
0
投票

我通过在项目结构的这个设置中添加资源文件夹来做到这一点

© www.soinside.com 2019 - 2024. All rights reserved.