title: Hibernate mapping can't find resources
body: <p>I'm trying to compile my project but the compiler keeps giving the error that he can't find my resource file and so he can't compile</p>
  
  <pre><code>    jul 23, 2013 1:29:24 PM org.hibernate.cfg.Configuration addResource
  INFO: HHH000221: Reading mappings from resource: src/main/resources/Movies.hbm.xml
  Initial SessionFactory creation failed.org.hibernate.MappingNotFoundException: resource: src/main/resources/Movies.hbm.xml not found
  Exception in thread "main" java.lang.ExceptionInInitializerError
      at com.hp.videotheek.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:17)
      at com.hp.videotheek.App.main(App.java:12)
  Caused by: org.hibernate.MappingNotFoundException: resource: src/main/resources/Movies.hbm.xml not found
      at org.hibernate.cfg.Configuration.addResource(Configuration.java:738)
      at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2167)
      at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2139)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2119)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2072)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1987)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1966)
      at com.hp.videotheek.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:13)
      ... 1 more
  </code></pre>
  
  <p>hibernate.cfg.xml file, here he can't find the mapping resources but it's on the right place</p>
  
  <pre><code>&lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
  
          &lt;!-- Database connection settings --&gt;
          &lt;property name="connection.url"&gt;jdbc:postgresql://localhost:5432/postgres&lt;/property&gt;
          &lt;property name="connection.driver_class"&gt;org.postgresql.Driver&lt;/property&gt;
          &lt;property name="connection.username"&gt;postgres&lt;/property&gt;
          &lt;property name="connection.password"&gt;****&lt;/property&gt;
          &lt;property name="transaction.factory_class"&gt;org.hibernate.transaction.JDBCTransactionFactory&lt;/property&gt;
  
          &lt;!-- SQL dialect --&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- Enable Hibernate's automatic session context management --&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
          &lt;!-- Drop and re-create the database schema on startup --&gt;
          &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  
          &lt;mapping resource="src/main/resources/Movies.hbm.xml"/&gt;
  
      &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Movies.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  
  &lt;hibernate-mapping package="com.hp.videotheek"&gt;
      &lt;class name="Movies" table="movies"&gt;
          &lt;id name="movie_id" column="movie_id"&gt;
              &lt;generator class="increment"/&gt;
          &lt;/id&gt;
          &lt;property name="movie_name" type="string" column="movie_name"/&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>In the screenshot you can see how I have set my mapping and where the files are in my my project</p>
  
  <p><img src="https://i.stack.imgur.com/VCUOt.png" alt="enter image description here"></p>