title: MappingNotFoundException in Hibernate
body: <p>I have followed <a href="http://www.mkyong.com/hibernate/maven-3-hibernate-3-6-oracle-11g-example-xml-mapping/" rel="nofollow noreferrer">this</a> tutorial. </p>
  
  <p>Here is my folder structure:</p>
  
  <p><img src="https://i.stack.imgur.com/Q4xkO.png" alt="enter image description here"></p>
  
  <p>When I run App.Java, I get:</p>
  
  <pre><code>Initial SessionFactory creation failed.org.hibernate.MappingNotFoundException: resource: com/mkyong/user/DBUser.hbm.xml not found
  </code></pre>
  
  <p>However, I have that file there as you can see it. When I put the file under</p>
  
  <pre><code>src/main/java/com/mykong/user/DBUser.hbm.xml
  </code></pre>
  
  <p>I am still getting this error.</p>
  
  <p>How can I make this example work?</p>
  
  <p>Thank you.</p>
  
  <p>Edit:</p>
  
  <pre><code>hibernate.cfg.xml
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
  
          &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/sampleapplication&lt;/property&gt;
          &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="connection.username"&gt;root&lt;/property&gt;
          &lt;property name="connection.password"&gt;MYPASSWORDHERE&lt;/property&gt;
  
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
          &lt;mapping resource="com/mkyong/user/DBUser.hbm.xml"&gt;&lt;/mapping&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>