title: Hibernate can't parse cfg file/create session factory
body: <p>Been stuck on this error for a few days now, any help  would be greatly appreciated. Thanks!</p>
  
  <p>Here is the error message from the console:</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.HibernateException: <strong>Could not parse configuration: /hibernate.cfg.xml</strong>
            at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1491)
            at org.hibernate.cfg.Configuration.configure(Configuration.java:1425)
            at org.hibernate.cfg.Configuration.configure(Configuration.java:1411)
            at hibernateTest.HibernateTest.main(HibernateTest.java:18)
        <strong><em>Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect</em></strong>
            at org.dom4j.io.SAXReader.read(SAXReader.java:484)
            at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
            ... 3 more</p>
  </blockquote>
  
  <p>Here is my hibernate.cfg.xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
  
      &lt;!-- Database connection settings --&gt;
      &lt;property name="connection.driver_class"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:oracle:thin:@ora-gpldev.xyz.com:1242:DUO231D&lt;/property&gt;
      &lt;property name="connection.username"&gt;user&lt;/property&gt;
      &lt;property name="connection.password"&gt;pass&lt;/property&gt;
  
      &lt;!-- JDBC connection pool (use the built-in) --&gt;
      &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  
      &lt;!-- SQL dialect --&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.Oracle9Dialect&lt;/property&gt;
  
      &lt;!-- Disable the second-level cache  --&gt;
      &lt;property name="cache.provider_class"&gt;org.hibernate.cache.EhCacheProvider&lt;/property&gt;
  
      &lt;!-- Echo all executed SQL to stdout --&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
  
      &lt;!-- Drop and re-create the database schema on startup --&gt;
      &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  
      &lt;!-- Names the annotated entity class --&gt;
      &lt;mapping class="helloHibernate.User"/&gt;
  
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Here is my HibernateTest.java class:</p>
  
  <pre><code>package hibernateTest;
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.cfg.Configuration;
  import helloHibernate.User;
  
  public class HibernateTest {
  
  public static void main(String[] args) {
      User user = new User();
      user.setUserId(1);
      user.setUserName("TheOne");
  
      SessionFactory sessionFactory = new    Configuration().configure().buildSessionFactory();
      Session session = sessionFactory.openSession();
      session.beginTransaction();
      session.save(user);
      session.getTransaction().commit(); 
      System.out.println("Saved!");
  }
  }
  </code></pre>
  
  <p>Here is my user class:</p>
  
  <pre><code>package helloHibernate;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name= "USER.USER2_TABLE")
  public class User {
  
  @Id
  private int userId;
  private String userName;
  
  public void setUserId(int userId){
      this.userId = userId; 
  }
  
  public int getUserId() {
      return userId;
  }
  
  public String getUserName() {
      return userName;
  }
  public void setUserName(String userName) {
      this.userName = userName;
  }
  }
  </code></pre>