title: Problems with dialect SQLite 3 with Hibernate 5
body: <p>I'm facing some problems with Hibernate-JPA-Maven</p>
  
  <p>It's the first time I use JPA and hibernate and I have some problems :
  I have a database that I have created with JPA and I would like to make some CRUD tests on it with JUnit5.
  With the pom.xml I add dependency to work with a SQLite dialect and hibernate, and I have a persistence.xml file.
  I use Eclipse to run the project to see if the first simple test works and i have this problem :</p>
  
  <blockquote>
    <p>oct. 28, 2017 2:42:32 PM org.hibernate.jpa.internal.util.LogHelper
    logPersistenceUnitInformation INFO: HHH000204: Processing
    PersistenceUnitInfo [     name: Bla   ...] oct. 28, 2017 2:42:32 PM
    org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core
    {5.2.12.Final} oct. 28, 2017 2:42:32 PM org.hibernate.cfg.Environment
     INFO: HHH000206: hibernate.properties not found oct. 28, 2017
    2:42:32 PM
    org.hibernate.annotations.common.reflection.java.JavaReflectionManager
     INFO: HCANN000001: Hibernate Commons Annotations
    {5.0.1.Final} oct. 28, 2017 2:42:33 PM
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
    configure WARN: HHH10001002: Using Hibernate built-in connection pool
    (not for production use!) oct. 28, 2017 2:42:33 PM
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
    buildCreator INFO: HHH10001005: using driver [org.sqlite.JDBC] at URL
    [jdbc:sqlite::memory:] oct. 28, 2017 2:42:33 PM
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
    buildCreator INFO: HHH10001001: Connection properties: {charSet=UTF-8,
    password=****, user=test} oct. 28, 2017 2:42:33 PM
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl
    buildCreator INFO: HHH10001003: Autocommit mode: false oct. 28, 2017
    2:42:33 PM
    org.hibernate.engine.jdbc.connections.internal.PooledConnections
     INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
    oct. 28, 2017 2:42:33 PM
    org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator
    initiateService WARN: HHH000342: Could not obtain connection to query
    metadata : Unable to determine Dialect to use [name=SQLite,
    majorVersion=3]; user must register resolver or explicitly set
    'hibernate.dialect' Exception in thread "main"
    org.hibernate.service.spi.ServiceException: Unable to create requested
    service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]   at  . . .
    Caused by: org.hibernate.HibernateException: Access to
    DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
      at  . . .   ... 14 more</p>
  </blockquote>
  
  <p>So I have i try to find out why I have :</p>
  
  <blockquote>
    <p>WARN: HHH000342: Could not obtain connection to query metadata :
    Unable to determine Dialect to use [name=SQLite, majorVersion=3]; user
    must register resolver or explicitly set 'hibernate.dialect'</p>
  </blockquote>
  
  <p>Apparently this is because SQLite 3 and Hibernate 5 are not compatible, so I try this : <a href="https://stackoverflow.com/questions/17587753/does-hibernate-fully-support-sqlite">Does Hibernate Fully Support SQLite</a> but it was not working for me.</p>
  
  <p>Then I try to take a lower version of hibernate and modify in my pom.xml the hibernate version and hibernate-core versions to 4.3.11.Final but same, it doesn't solved my problems.</p>
  
  <p>After many hours on that, I can't figure it out if the problems comes from the version of hibernate and SQLite, or if this is a problem of the configuration in my pom.xml (a missing dependency ?) or it's my persistance.xml, or this comes from my class Test.</p>
  
  <p><a href="https://i.stack.imgur.com/4YWWF.png" rel="noreferrer">File tree of my project</a></p>
  
  <p>Please let me know if you need more details.
  Thank you in advance for your help.</p>
  
  <p>My pom.xml file :
  </p>
  
  <pre><code>&lt;project
      xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;fr.umlv.orthopro&lt;/groupId&gt;
    &lt;artifactId&gt;OrthoPro_brain&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;OrthoPro_brain&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
       &lt;java.version&gt;9&lt;/java.version&gt;
       &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
       &lt;junit.jupiter.version&gt;5.0.1&lt;/junit.jupiter.version&gt;
       &lt;junit.platform.version&gt;1.0.1&lt;/junit.platform.version&gt;
       &lt;hibernate.version&gt;5.2.12.Final&lt;/hibernate.version&gt;
       &lt;sqlite.version&gt;3.20.1&lt;/sqlite.version&gt;
    &lt;/properties&gt;
  
    &lt;build&gt;
       &lt;plugins&gt;
           &lt;plugin&gt;
               &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
               &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
               &lt;version&gt;3.7.0&lt;/version&gt;
               &lt;configuration&gt;
                   &lt;source&gt;${java.version}&lt;/source&gt;
                   &lt;target&gt;${java.version}&lt;/target&gt;
                   &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                   &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
               &lt;/configuration&gt;
           &lt;/plugin&gt;
           &lt;plugin&gt;
               &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
               &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
               &lt;version&gt;3.0.0-M1&lt;/version&gt;
               &lt;configuration&gt;
                   &lt;reportOutputDirectory&gt;${project.build.directory}/javadoc&lt;/reportOutputDirectory&gt;
                   &lt;destDir&gt;javadoc&lt;/destDir&gt;
                   &lt;nohelp&gt;true&lt;/nohelp&gt;
               &lt;/configuration&gt;
           &lt;/plugin&gt;
       &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
           &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
           &lt;version&gt;${junit.jupiter.version}&lt;/version&gt;
           &lt;scope&gt;test&lt;/scope&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.junit.platform&lt;/groupId&gt;
           &lt;artifactId&gt;junit-platform-runner&lt;/artifactId&gt;
           &lt;version&gt;${junit.platform.version}&lt;/version&gt;
           &lt;scope&gt;test&lt;/scope&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
           &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
           &lt;version&gt;${hibernate.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
           &lt;groupId&gt;org.xerial&lt;/groupId&gt;
           &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
           &lt;version&gt;${sqlite.version}&lt;/version&gt;
           &lt;!-- &lt;scope&gt;test&lt;/scope&gt; --&gt;
       &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.jpa&lt;/artifactId&gt;
          &lt;version&gt;2.7.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;5.2.12.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
          &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
          &lt;version&gt;2.3.0&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
   &lt;/project&gt;
  </code></pre>
  
  <p>My persistence.xml file :</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
                   http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
                   version="2.1"&gt;
  
          &lt;persistence-unit name="first_test" transaction-type="RESOURCE_LOCAL"&gt;
            &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
             &lt;class&gt;fr.umlv.orthpro.db.User&lt;/class&gt;
             &lt;class&gt;fr.umlv.orthpro.db.Rule&lt;/class&gt;
             &lt;class&gt;fr.umlv.orthpro.db.UserRule&lt;/class&gt;
             &lt;class&gt;fr.umlv.orthpro.db.Sentence&lt;/class&gt;
  
              &lt;properties&gt;
                  &lt;property name="dialect" value="org.hibernate.dialect.SQLiteDialect" /&gt;
                  &lt;property name="javax.persistence.jdbc.driver" value="org.sqlite.JDBC" /&gt;
                  &lt;property name="javax.persistence.jdbc.url" value="jdbc:sqlite::memory:" /&gt;
                  &lt;property name="javax.persistence.jdbc.user" value="test" /&gt;
                  &lt;property name="javax.persistence.jdbc.password" value="test" /&gt;
                  &lt;property name="hibernate.show_sql" value="true" /&gt;
                  &lt;property name="format_sql" value="true" /&gt;
                  &lt;property name="hibernate.connection.charSet" value="UTF-8" /&gt;
                  &lt;property name="hibernate.hbm2ddl.auto" value="create" /&gt;
              &lt;/properties&gt;
          &lt;/persistence-unit&gt;
      &lt;/persistence&gt;
  </code></pre>
  
  <p>This is my class to run test on the database :
  </p>
  
  <pre><code>package fr.umlv.orthopro.db;
  
  import javax.persistence.EntityManager;
  import javax.persistence.EntityManagerFactory;
  import javax.persistence.Persistence;
  
  public class Test {
        EntityManagerFactory emfactory = Persistence.createEntityManagerFactory( "first_test" );
  
        EntityManager entitymanager = emfactory.createEntityManager( );
        entitymanager.getTransaction( ).begin( );
  
        User quentin = new User( ); 
        quentin.setId(1201);
        quentin.setAdmin(false);
  
        entitymanager.persist( quentin );
        entitymanager.getTransaction( ).commit( );
        entitymanager.close( );
        emfactory.close( );
      }
  }
  </code></pre>
  
  <p>EDIT : I change<br>
  <code>&lt;property name="dialect" value="org.hibernate.dialect.SQLiteDialect" /&gt;</code> to<br>
  <code>&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLiteDialect" /&gt;</code>
  and now I have this :</p>
  
  <blockquote>
    <p>Unable to resolve name [org.hibernate.dialect.SQLiteDialect] as
    strategy [org.hibernate.dialect.Dialect]</p>
  </blockquote>