Error while reading the hbm.xml file

I am unable to read hbm.xml. getting the below error.

INFO: HHH000220: Reading mappings from file: Database_configuration_files\Delete.hbm.xml
Error: INFO | jvm 1 | 2018/10/23 13:56:38 | file: Database_configuration_files\Delete.hbm.xml not found.

Please find the attachment with structure.
Please help me to resoerror lve this issue

Try it like this:


cfg.addFile(“Database_configuration_files/Delete.hbm.xml”) is working fine. when i am creating a runnable jar for the above code. I am getting this error " HHH000220: Reading mappings from file: Database_configuration_files\Delete.hbm.xml ".

Let me know if you need any additional information.

The Configuration bootstrap is deprecated. Also, you need to use a build tool like Maven to build a project, not from the IDE.

In your case, you should use addResource:


The addFile works with file paths that can be resolved on disk, not on the classpath. So, unless you are using an absolute file path, the program will run only when the relative path can be resolved from the calling command path.

Thank you so much. This helped me to resolve the issue. Thank you