title: hibernate.cfg.xml not found
body: <p>I am new to Hibernate, reading this book "Java persistence with Hibernate" and I am trying to implement the example from there. So far my Ant build is successful, but when I try to execute the class containing the main method I am getting this error message:</p>
  
  <pre><code>19-Nov-2011 18:40:09 org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: Hibernate 3.2.3
  19-Nov-2011 18:40:09 org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: hibernate.properties not found
  19-Nov-2011 18:40:09 org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: Bytecode provider name : cglib
  19-Nov-2011 18:40:09 org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: using JDK 1.4 java.sql.Timestamp handling
  19-Nov-2011 18:40:09 org.hibernate.cfg.Configuration configure
  INFO: configuring from resource: /hibernate.cfg.xml
  19-Nov-2011 18:40:09 org.hibernate.cfg.Configuration getConfigurationInputStream
  INFO: Configuration resource: /hibernate.cfg.xml
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at persistence.HibernateUtil.&lt;clinit&gt;(Unknown Source)
      at hello.Driver.main(Unknown Source)
  Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
      at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
      at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1405)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1427)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
      ... 2 more
  </code></pre>
  
  <p>It is clear that hibernate can't find my config file, which is located in the root dir.</p>
  
  <p>Project</p>
  
  <pre><code>+lib
  &lt;all required libraries&gt;
  +src
    +hello
      HelloWorld.java
      Message.java
      message.hbm.xml
    +persistence
      HibernateUtil.java
  build.xml
  hibernate.cfg.xml
  </code></pre>
  
  <p>My the complete source code can be found here: <a href="http://pastebin.com/bGDUrxUf" rel="noreferrer">http://pastebin.com/bGDUrxUf</a></p>
  
  <p>I have a running MySQL server with a database hibernateapp and table messages</p>
  
  <p>Thanks :)</p>