title: org.hibernate.MappingException: <mapping> element in configuration specifies no known attributes
body: <p>When i run the code it gives me an exception: </p>
  
  <blockquote>
    <p>org.hibernate.MappingException:  element in configuration specifies no known attributes </p>
  </blockquote>
  
  <p>I am not sure where error occurs, can anyone help me to solve this..</p>
  
  <p><strong>hibernate.cfg.xml</strong></p>
  
  <pre><code>     &lt;hibernate-configuration&gt;
       &lt;session-factory&gt;
       &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&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;"url"&lt;/property&gt;
  &lt;property name="hibernate.connection.username"&gt;"username"&lt;/property&gt;
  &lt;property name="hibernate.connection.password"&gt;"password"&lt;/property&gt;
  &lt;mapping resource="student.hbm.xml"/&gt;
  &lt;mapping/&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p><strong>Student.java</strong></p>
  
  <pre><code>public class Student {
  
  private String name;
   private int id;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public int getId() {
      return id;
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  }
  
  Regular.java
  
   public class Regular extends Student {
  
  String coursefees;
  
  public String getCoursefees() {
      return coursefees;
  }
  
  public void setCoursefees(String coursefees) {
      this.coursefees = coursefees;
  }
  
  }
  </code></pre>
  
  <p><strong>Distant.java</strong></p>
  
  <pre><code> public class Distant extends Student {
  
  String distantfees;
  
  public String getDistantfees() {
      return distantfees;
  }
  
  public void setDistantfees(String distantfees) {
      this.distantfees = distantfees;
  }
  
  }
  </code></pre>
  
  <p><strong>student.hbm.xml</strong></p>
  
  <pre><code>       &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="pojos.Student" table="student" discriminator-       value="student"&gt;  
         &lt;id name="id" type="int"&gt;  
         &lt;column name="id"/&gt;
         &lt;generator class="increment"&gt;&lt;/generator&gt;  
         &lt;/id&gt;  
  
         &lt;discriminator column="type" type="string"&gt;&lt;/discriminator&gt;  
         &lt;property name="name" type="string"&gt;
         &lt;column name="sname"/&gt;
          &lt;/property&gt;
  
       &lt;subclass name="pojos.Regular" discriminator-value="regstud"&gt;  
       &lt;property name="coursefees" type="string"&gt;
       &lt;column name="coursefees"/&gt;
       &lt;/property&gt;  
      &lt;/subclass&gt;   
  
     &lt;subclass name="pojos.Distant" discriminator-value="distant"&gt;  
     &lt;property name="distantfees" type="string"&gt;
    &lt;column name="distfees"/&gt;
    &lt;/property&gt;  
    &lt;/subclass&gt;
  
   &lt;/class&gt;
  
   &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Exception in thread "main" org.hibernate.MappingException:  element in configuration specifies no known attributes
        at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2286)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2227)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2207)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2160)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:2075)</p>
  </blockquote>