title: Issue connecting to mysql database using hibernate.xml
body: <p>I am unable to connect to a mysql database using xml. I have no problem using an hibernate.properties file, but when i substitute it with an xml it doesn't work. The xml in <code>main/resources</code> is</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;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/ifinances&lt;/property&gt;
      &lt;property name="connection.username"&gt;infinite&lt;/property&gt;
      &lt;property name="connection.password"&gt;skills&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQL5Dialect&lt;/property&gt;
  
      &lt;mapping class="com.infiniteskills.data.entities.User" /&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I have a utility SessionFactory class that returns this </p>
  
  <pre><code>private static SessionFactory buildSessionFactory() {
      try {
          Configuration configuration = new Configuration();
          return configuration
                  .buildSessionFactory(new StandardServiceRegistryBuilder()
                  .applySettings(configuration.getProperties()).build());
      } catch (Exception e) {
          e.printStackTrace();
          throw new RuntimeException("Error in building the factory");
      }
  }
  </code></pre>
  
  <p>After i retrieve it and i call the method <code>.openSession()</code> i have the following error</p>
  
  <pre><code>WARN - HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
  WARN - HHH000342: Could not obtain connection to query metadata : The application must supply JDBC connections
  org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:271)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
  at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
  at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:242)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
  at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
  at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
  at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
  at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
  at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691)
  at com.infiniteskills.data.HibernateUtil.buildSessionFactory(HibernateUtil.java:18)
  at com.infiniteskills.data.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:11)
  at com.infiniteskills.data.Application.main(Application.java:18)
  Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
  at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
  at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
  at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
  at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
  at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
  at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259)
  ... 15 more
  Exception in thread "main" java.lang.ExceptionInInitializerError
  at com.infiniteskills.data.Application.main(Application.java:18)
  Caused by: java.lang.RuntimeException: Error in building the factory
  at com.infiniteskills.data.HibernateUtil.buildSessionFactory(HibernateUtil.java:22)
  at com.infiniteskills.data.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:11)
  ... 1 more
  </code></pre>