title: Spring app cant find hbm.xml mapping file
body: <p>I am working on a spring mvc app using hibernate and I am having some trouble compiling and running my code.</p>
  
  <p>This is because it cannot find my FileObject.hbm.xml whenever I try to create a session factory bean.</p>
  
  <p>my bean looks like this</p>
  
  <pre><code>&lt;bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource1"&gt;&lt;/property&gt;
      &lt;property name="mappingResources"&gt;
          &lt;list&gt;
              &lt;value&gt;FileObject.hmb.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;create&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And the FileObject.hmb.xml resides in the root of my WAR folder. I have tried to move this file to different folders including the actual src folder and providing the correct path in the session factory but it still gives me a FileNotFoundException.</p>
  
  <p>Is this because java doesnt recognise a hello.hmb.xml type of file? Most if not all file formats are like this: name.extension</p>
  
  <p>hibernate mapping files seems to be different though</p>
  
  <p><strong>Follow-up:</strong> As I have noted before, I have tried to put my .hbm.xml in numerous places including the src directory and still wont work.</p>
  
  <p>My project structure is similar to this:</p>
  
  <p><a href="https://i.stack.imgur.com/2pec5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2pec5.png" alt="project structure"></a><br>
  <sub>(source: <a href="http://static.springsource.org/docs/Spring-MVC-step-by-step/images/dir-structure-endp1.png" rel="nofollow noreferrer">springsource.org</a>)</sub>  </p>
  
  <p>I have tried to put the file inside the root dir of war, WEB-INF, classes and as said before, in my actual src directory.</p>
  
  <p>I never knew it was this much hassle just to get hibernate and spring running successfully.</p>