-3

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pavi
  • 1
  • 1
  • 3
    Welcome to StackOverflow. Please go through these two pages - [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – vinS Dec 17 '17 at 08:15
  • Possible duplicate of [Spring cannot find bean xml configuration file when it does exist](https://stackoverflow.com/questions/12893760/spring-cannot-find-bean-xml-configuration-file-when-it-does-exist) – Codemole Dec 17 '17 at 12:22
  • Have you checked this? https://stackoverflow.com/questions/12893760/spring-cannot-find-bean-xml-configuration-file-when-it-does-exist – Codemole Dec 17 '17 at 12:23

2 Answers2

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pavi
  • 1
  • 1
0

You can solve the issue by

  1. beans.xml file in com.tuto package so move to src folder
  2. specify the com.tuto.Beans.xml in ApplicationContext
Sasikumar Murugesan
  • 4,412
  • 10
  • 51
  • 74