title: Could not parse configuration: hibernate.cfg.xml
body: <p>Actually I am trying to do hibernate logging. This is my hibernate.cfg.xml file</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;!-- Generated by MyEclipse Hibernate Tools.                   --&gt;
  &lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
          &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:oracle//localhost/5432/newdatabase&lt;/property&gt;
          &lt;property name="connection.username"&gt;postgres&lt;/property&gt;
          &lt;property name="connection.password"&gt;P@ssword&lt;/property&gt;
          &lt;property name="connection.driver_class"&gt;org.postgresql.Driver&lt;/property&gt;
  
      &lt;mapping resource="employee.hbm.xml"/&gt;
  
      &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>This is my main class</p>
  
  <pre><code>package com.javatpoint;
  import org.hibernate.*;
  import org.hibernate.cfg.*;
  
  public class StoreData {
  public static void main(String[] args) {
  
      Configuration cfg=new Configuration();
      cfg.configure("hibernate.cfg.xml");
  
      SessionFactory factory=cfg.buildSessionFactory();
      Session session=factory.openSession();
      Transaction tx=session.beginTransaction();
  
      session.save(new Employee("Arun",3800));
      session.save(new Employee("Varun",4800));
  
      tx.commit();
      session.close();
      System.out.println("record successfully persisted");
  
  }
  }
  </code></pre>
  
  <p>When i run this I am getting the following error.</p>
  
  <pre><code>Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1491)
      at org.hibernate.cfg.Configuration.configure(Configuration.java:1425)
      at com.javatpoint.StoreData.main(StoreData.java:9)
  Caused by: org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net
      at org.dom4j.io.SAXReader.read(SAXReader.java:484)
      at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
      ... 2 more
  </code></pre>
  
  <p>After a lot of googling I came to know that it is something related to DOCTYPE. But even then I am unable to find a perfect solution for this. Could someone help me.? Thanks.</p>