title: Hibernate fails create sessionfactory using HikariCP pool
body: <p>I try to use HikariCP pool connection, but I can't make app starts because I get all time, a null object from create sesion.</p>
  
  <p>This is my configuration:</p>
  
  <p><strong>System</strong></p>
  
  <ul>
  <li>Hibernate 4.3.6.Final </li>
  <li>MariaDB v10.0 (x64)</li>
  </ul>
  
  <p><strong>HibernateUtil class</strong></p>
  
  <pre><code>public class HibernateUtil {
  private static SessionFactory sessionFactory;
  
  private static SessionFactory buildSessionFactory() {
      try {
          Configuration configuration = new Configuration();
          configuration.configure("hibernate.cfg.xml");
          ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
          sessionFactory = configuration.buildSessionFactory(serviceRegistry);
  
          return sessionFactory;
      }
      catch (HibernateException ex) {
          throw new ExceptionInInitializerError(ex);
      }
  }
  
  public static SessionFactory getSessionFactory() {
      if (sessionFactory == null) {
          sessionFactory = buildSessionFactory();
      }
      return sessionFactory;
  }
  }
  </code></pre>
  
  <p><strong>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://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;!-- Datos de conexión a la BD --&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;jdbc:mysql://localhost:3307/******?zeroDateTimeBehavior=convertToNull&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;****&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;****&lt;/property&gt;
          &lt;property name="javax.persistence.validation.mode"&gt;none&lt;/property&gt;
          &lt;!-- Configuración de sesión --&gt;
          &lt;property name="connection.release_mode"&gt;after_transaction&lt;/property&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;!-- Configuración de la salida SQL y estadísticas --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
          &lt;property name="format_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.temp.use_jdbc_metadata_defaults"&gt;false&lt;/property&gt;
          &lt;!-- Pool de conexiones --&gt;
          &lt;property name="hibernate.connection.provider_class"&gt;org.mariadb.jdbc.MySQLDataSource&lt;/property&gt;
          &lt;!-- Enable Hibernate's current session context --&gt;
          &lt;property name="hibernate.cache.use_second_level_cache"&gt;false&lt;/property&gt;
          &lt;property name="hibernate.cache.use_query_cache"&gt;false&lt;/property&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p><strong>LOG</strong></p>
  
  <blockquote>
    <p>Preparing to build session factory with filters : 
    {} HHH000130: Instantiating explicit connection provider: org.mariadb.jdbc.MySQLDataSource
    Exception in Application start method</p>
  </blockquote>