Put it on your classpath, but more specifically, in a location that the classloader that loads and initializes the Configuration, or AnnotationConfiguration object, can find it.
In Eclipse, or Rational Application Developer/RSA I typically see a folder named src in the web app. I put my packages and classes in there:
src\com\mcnz\data\HibernateUtil.java
In this case, I would place the hibernate.cfg.xml file in the src folder:
src\hibernate.cfg.xml
You would put your log4j.properties file in the same location.
The other important thing is to make sure that your hibernate.cfg.xml file gets moved to your build folder during deployment as well.
Now, you might actually want to code your Hibernate specific stuff outside of a web app, in an isolated, reusable, testable,
Java project. Then your web app can just link to this Java project/jar file when needed. Still, the same rules apply. Just make sure the hibernate.cfg.xml file can be found by the Configuration object that gets initialized.
-Cameron McKenzie
[ May 26, 2008: Message edited by: Cameron Wallace McKenzie ]