How do I solve " java.io.FileNotFoundException: class path resource [Beans.xml] cannot be opened because it does not exist " this error?

时间:2017-12-17 08:12:53

标签: java spring

My question is about this error message:

java.io.FileNotFoundException: class path resource [Beans.xml] cannot be opened because it does not exist

How do I solve it?

Enter image description here

In the image we can spot an error in the console window and also can see the main method program.

2 个答案:

答案 0 :(得分:0)

For this kind of exception, check you have created an XML file in the src folder directly, not in the package where your main class is present. I solved this program by the same method.

答案 1 :(得分:0)

您可以通过

解决问题
    com.tuto包中的
  1. beans.xml文件,所以移动到src文件夹
  2. com.tuto.Beans.xml
  3. 中指定ApplicationContext