title: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set using spring-boot
body: <p>I am trying to configure hibernate in my spring-boot project.</p>
  
  <p>I have application.properties file</p>
  
  <pre><code>spring.datasource.url=jdbc:mysql:url?useSSL=false
  spring.datasource.username=name
  spring.datasource.password=password
  
  hibernate.connection.driver_class = com.mysql.jdbc.Driver
  hibernate.connection.url = jdbc:mysql:url
  hibernate.connection.username = name
  hibernate.connection.password = password
  hibernate.c3p0.min_size=5
  hibernate.c3p0.max_size=20
  hibernate.c3p0.timeout=1800
  hibernate.c3p0.max_statements=50
  hibernate.dialect=org.hibernate.dialect.MySQLDialect
  </code></pre>
  
  <p>And method for registering user in UserDAO class:</p>
  
  <pre><code>public void registerUser(User u){
      Session session = factory.openSession();
      Transaction tx = null;
      try {
          tx = session.beginTransaction();
          session.save(u);
          tx.commit();
      } catch (HibernateException e) {
          if (tx!=null) tx.rollback();
          e.printStackTrace();
      } finally {
          session.close();
      }
      System.out.println("yay all done");
  }
  </code></pre>
  
  <p>However i am recieving error:</p>
  
  <pre><code>&gt; Caused by: org.hibernate.service.spi.ServiceException: Unable to
  &gt; create requested service
  &gt; [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]   at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.internal.InFlightMetadataCollectorImpl.&lt;init&gt;(InFlightMetadataCollectorImpl.java:179)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:84)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:474)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:85)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:689)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; com.groups.data.UserDAO.&lt;init&gt;(UserDAO.java:18) ~[classes/:na]    ... 52
  &gt; common frames omitted Caused by: org.hibernate.HibernateException:
  &gt; Access to DialectResolutionInfo cannot be null when
  &gt; 'hibernate.dialect' not set   at
  &gt; org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     at
  &gt; org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
  &gt; ~[hibernate-core-5.3.2.Final.jar:5.3.2.Final]     ... 66 common frames
  &gt; omitted
  </code></pre>
  
  <p>I have configured dialect as it requires, i have even tried creating good old <code>hibernate.cfg.xml</code> file but the error remained the same ( it even seemed it ignored the file).</p>
  
  <p>Why is ist happening? Literally yesterday it worked without problem. Today i tried creating the cfg file and it stopped working ( deleted it already ).</p>
  
  <p>The more i try to configure hibernate the more it seems it was made to anger anyone who is using it and impossible to make it work.</p>
  
  <p>WHat could be the problem here?</p>
  
  <p>Thanks for help!</p>