title: org.hibernate.MappingNotFoundException: resource: hibernate.hbm.xml not found
body: <p>Help me to resolve this issue .it is not connecting to the data base and ia m using wamp server as database</p>
  
  <p>[File hierarchy][1]</p>
  
  <p>></p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>public boolean login() {
  
      try{
        SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
        Session session=sessionFactory.openSession();
        session.beginTransaction();
        Query query=session.createQuery("from Login where username=:username and password=:password");
        query.setString("username", username);
        query.setString("password", password);
        List list=query.list();
  
        System.out.println("list size"+list.size());
  
         if(list.size()==1){
         return true;
         }else{
         return false;
                 }
           }
  
      catch(Exception e)
      {
          System.out.println(e);
      }
      return false;
  }
  </code></pre>
  
  
  
  <p>Log  file and i am using glass fish server
  </p>
  
  <pre class="lang-html prettyprint-override"><code>HHH000043: Configuring from resource: /hibernate.cfg.xml
  Info:   HHH000040: Configuration resource: /hibernate.cfg.xml
  WARN:   HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
  Info:   HHH000221: Reading mappings from resource: hibernate.hbm.xml
  WARN:   HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
  WARN:   HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
  ERROR:   HHH000196: Error parsing XML (2) : The content of element type "class" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,fetch-profile*,resultset*,(query|sql-query)*)".
  Info:   org.hibernate.InvalidMappingException: Unable to read XML
      at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:109)
      at org.hibernate.cfg.Configuration.add(Configuration.java:488)
  </code></pre>
  
  
  
  <p>hiberanate config file :hibernate.config.xml</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/jsfformdb&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
      &lt;!--  &lt;property name="password" /&gt; 
      &lt;property name="connection.pool_size"&gt;1&lt;/property&gt; --&gt; 
      &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;
      &lt;!--&lt;mapping class="Login.Login"&gt;&lt;/mapping&gt;--&gt;
      &lt;mapping resource="hibernate.hbm.xml"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  
  
  <p>--></p>
  
  <p>Hiberanet mapping file:hibernate.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
    &lt;class name="Login.Login" table="login1"/&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>