title: Hibernate: An AnnotationConfiguration instance is required to use ... error
body: <p>I build my HibernateUtil this way :</p>
  
  <pre><code>public class HibernateUtil {
  
          private static final SessionFactory sessionFactory;
  
          static {
              try { 
                  // Create the SessionFactory from standard (hibernate.cfg.xml) config file.
                  sessionFactory = new Configuration().configure().buildSessionFactory();
  
              } catch (Throwable ex) {
                  // Log the exception. 
                  System.err.println("Initial SessionFactory creation failed." + ex);
                  throw new ExceptionInInitializerError(ex);
              }
          }
  
          public static SessionFactory getSessionFactory() {
              return sessionFactory;
          }
  }
  </code></pre>
  
  <p>So when I try to execute the HQL command in HQL Editor in Eclipse (with Hibernate Tools) gives the follow error:
  <img src="https://i.stack.imgur.com/dDOYh.png" alt="enter image description here">
  Why this happening ? It shouln't change the AnnotationConfiguration by ConfigureAnnotation ?</p>
  
  <p><strong>UPDATE</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="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;&lt;password&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://&lt;hostname&gt;:3306/&lt;schema&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;!-- &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt; --&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
          &lt;!-- SQL --&gt;
          &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;!-- C3P0 --&gt;
          &lt;property name="hibernate.c3p0.acquire_increment"&gt;2&lt;/property&gt;
          &lt;property name="hibernate.c3p0.max_size"&gt;20&lt;/property&gt;
          &lt;property name="hibernate.c3p0.min_size"&gt;5&lt;/property&gt;
          &lt;property name="hibernate.c3p0.timeout"&gt;180&lt;/property&gt;
          &lt;property name="hibernate.c3p0.idle_test_period"&gt;100&lt;/property&gt;
          &lt;!-- Classes --&gt;
          &lt;mapping class="com.suaparte.pojo.Area" /&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>