My friend Google told me I should put the classname.hbm.xml to where classname.java stays at.
But it doesn’t work, saying
resource: AccountsRequest.hbm.xml not found
AccountsRequest is the java class name. I use javac to compile. Not sure if it is the reason. AccountsRequest.java is at /WEB-INF/src/.
EDITED: in hibernate.cfg.xml i have
resource=”AccountsRequest.hbm.xml”/>
hibernate.cfg.xml is at /WEB-INF/.
Thanks!
You need to put it in the runtime classpath. The
/WEB-INF/classesis covered by the webapp’s default runtime classpath. So it should end up there.However, if you’re using an IDE, you can also drop them in
srcfolder of the project (no, not/WEB-INF/src!), a bit decent IDE will then automagically put it in/WEB-INF/classesduring build.