My project is like this:
/src/main/java
-thegamers
-app.java
-hibernateutil.java
can someone tell me where to put th
try to place it into "src/main/resources
" directory.
If you are using Eclipse, go to Project -> Properties -> Java Build Path -> Source. You can add the new folder where you placed the file, or move the file to the existing folder.
The file is suppose to go into the root of your /src
dir, while /src
is not deployed, everything in it is built/copied out to WEB-INF/classes
which IS deployed. Hibernate needs the cfg.xml
file in the classpath
of your project to load its config settings, your WEB-INF
dir is not in your classpath
, so if you were to put it there, you'd be hiding it from Hibernate and it wouldn't work.
This thread would tell you how to load the hibernate.cfg.xml from any different path.