Skip to content
Advertisement

“Could not locate cfg.xml resource [hibernate.cfg.xml]” error

When I run my createStudentDemo class I get the following error:

I don’t understand why I have this error.

Here is the code of my createStudentDemo class:

and here is the code for my class student:

and here is the code of my hibernate.cfg.xml file:

and here is the location of my files:

location files

Can someone help me please?

Advertisement

Answer

You hibernate.cfg.xml should be in classpath. Put it in src folder.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement