title: Hibernate exception hibernate.cfg.xml not found
body: <p>
  I'm trying to start project with Hibernate and Maven.</p>
  
  <p><strong>I got such exception:</strong></p>
  
  <pre><code>SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  SLF4J: Defaulting to no-operation (NOP) logger implementation
  SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
  Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found
      at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
      at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2176)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:2157)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
      at FirstHibernate.com.myhib.CRUDS.CrudsOps.main(CrudsOps.java:15)
  </code></pre>
  
  <p>Here is the screenshot of my project structure, (hibernate.cfg.xml is in src/):
  <a href="http://imageshack.us/photo/my-images/692/screenshotxba.jpg/" rel="noreferrer">http://imageshack.us/photo/my-images/692/screenshotxba.jpg/</a></p>
  
  <p><strong>CrudsOps.java</strong></p>
  
  <pre><code>package FirstHibernate.com.myhib.CRUDS;
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.cfg.Configuration;
  
  public class CrudsOps {
  
      /**
       * @param args
       */
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
          SessionFactory sf = new Configuration().configure().buildSessionFactory();
          System.out.println("Cfg and hbm files loaded succesfully");
          Session session = sf.openSession();
          session.beginTransaction();
          System.out.println("Transaction began");
  
      }
  
  }
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;FirstHibernate&lt;/groupId&gt;
    &lt;artifactId&gt;com.myhib&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;com.myhib Maven Webapp&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;3.6.8.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;9.1-901.jdbc4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;4.2.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;finalName&gt;com.myhib&lt;/finalName&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>What could be a source of that exception?
  </p>