title: In Hibernate,I am getting following error at runtime
body: <p>In Hibernate,I am getting following error at runtime</p>
  
  <p><strong>1. employee.hbm.xml</strong></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 package ="com.hibernate.basic"&gt;
  
  
  
      &lt;class name="Employee" table="Employee" lazy="false"&gt;
  
          &lt;id name="id" column="EMPID" type ="int"&gt;
  
              &lt;generator class="increment"&gt;&lt;/generator&gt;
          &lt;/id&gt;
  
          &lt;property name="firstName" column="NAME"&gt;&lt;/property&gt;
          &lt;property name="lastName"column="LNAME"&gt;&lt;/property&gt;
  
      &lt;/class&gt;
  </code></pre>
  
  <p><strong>2. hibernate.cfg.xml</strong></p>
  
  <pre><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="connection.driver_class"&gt;oracle.jdbc.OracleDriver&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:oracle:thin:@172.16.3.94:1521:EAMABP&lt;/property&gt;
          &lt;property name="connection.username"&gt;EAM&lt;/property&gt;
          &lt;property name="connection.password"&gt;EAM&lt;/property&gt;
          &lt;property name="hibernate.connection.pool_size"&gt;10&lt;/property&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;mapping resource="employee.hbm.xml" /&gt;
      &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p><strong>3. Employee.java</strong></p>
  
  <pre><code>package com.hibernate.basic;
  
  public class Employee {
  
      private int id;
      private String FName, LName;
  
      public String getFName() {
  
          return FName;
      }
  
      public void setFName(String FName) {
  
          this.FName = FName;
      }
  
      public String getLName() {
          return LName;
      }
  
      public void setLName(String LName) {
  
          this.LName = LName;
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  }
  </code></pre>
  
  <p><strong>4. StoreData.java</strong></p>
  
  <pre><code>package com.hibernate.basic;
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.Transaction;
  import org.hibernate.cfg.Configuration;
  
  public class StoreData {
      public static void main(String[] args) {
  
          // creating configuration object
          Configuration cfg = new Configuration();
          cfg.configure("hibernate.cfg.xml");// populates the data of the
                                              // configuration file
  
          // creating seession factory object
          SessionFactory factory = cfg.buildSessionFactory();
  
          // creating session object
          Session session = factory.openSession();
  
          // creating transaction object
          Transaction t = session.beginTransaction();
  
          Employee e1 = new Employee();
          e1.setId(115);
          e1.setFName("sonoo");
          e1.setLName("jaiswal");
  
          session.persist(e1);// persisting the object
  
          t.commit();// transaction is commited
          session.close();
  
          System.out.println("successfully saved");
  
      }
  }
  </code></pre>
  
  <p>Error occurred after execution:  </p>
  
  <blockquote>
    <p>log4j:WARN No appenders could be found for logger
    (org.hibernate.cfg.Environment). log4j:WARN Please initialize the
    log4j system properly. Exception in thread "main"
    org.hibernate.InvalidMappingException: Could not parse mapping
    document from resource employee.hbm.xml   at
    org.hibernate.cfg.Configuration.addResource(Configuration.java:569)
      at
    org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587)
      at
    org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
      at
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
      at
    org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
      at com.hibernate.basic.StoreData.main(StoreData.java:13) Caused by:
    org.hibernate.InvalidMappingException: Could not parse mapping
    document from input stream    at
    org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508)
      at
    org.hibernate.cfg.Configuration.addResource(Configuration.java:566)
      ... 6 more Caused by: org.dom4j.DocumentException: Error on line 14
    of document  : Element type "property" must be followed by either
    attribute specifications, ">" or "/>". Nested exception: Element type
    "property" must be followed by either attribute specifications, ">" or
    "/>".     at org.dom4j.io.SAXReader.read(SAXReader.java:482)  at
    org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
      ... 7 more</p>
  </blockquote>