title: LocalSessionFactoryObject - MappingResources - Path to the hbm file
body: <p>The project structure is:</p>
  
  <p><img src="https://i.stack.imgur.com/vJ256.png" alt="enter image description here"></p>
  
  <p>Now I am trying to create a bean <code>NHibernateSessionFactory</code> as:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate32"&gt;
      &lt;property name="DbProvider" ref="DbProvider"/&gt;
      &lt;property name="MappingResources"&gt;
      &lt;list&gt;
          &lt;value&gt;EMSApplication.Domain/EMSApplication.hbm.xml&lt;/value&gt;
      &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="HibernateProperties"&gt;
      &lt;dictionary&gt;
          &lt;entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/&gt;
          &lt;entry key="dialect" value="NHibernate.Dialect.MsSql2008Dialect"/&gt;
          &lt;entry key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/&gt;
          &lt;entry key="proxyfactory.factory_class" value="NHibernate.Bytecode.DefaultProxyFactoryFactory, NHibernate"/&gt;
          &lt;entry key="show_sql" value="true"/&gt;
          &lt;entry key="hbm2ddl.auto" value="update"/&gt;
          &lt;entry key="cache.use_query_cache" value="true"/&gt;
      &lt;/dictionary&gt;
      &lt;/property&gt;
  
      &lt;property name="ExposeTransactionAwareSessionFactory" value="true" /&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>But I am getting the error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>Error creating context 'spring.root': file [C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\EMSApplication.Domain\EMSApplication.hbm.xml] cannot be resolved to local file path - resource does not use 'file:' protocol.
  </code></pre>
  
  <p>Now the project is on D drive, I am wondering why this is pointing C drive? </p>
  
  <p>Also how can I add the specified hbm file in the mapping resource? This file is set as 'Embedded Resource'. </p>
  
  <p>Is there any way to specify a directory here to scan for the multiple hbm files?</p>
  
  <p>Any information will be very helpful to me.</p>