Mincong Huang
Mincong Huang

Reputation: 5552

HHH000431: Unable to determine H2 database version, certain features may not work

I'm running an integration test in WildFly 10 and when the server starts, there's a warning about the H2 database version:

HHH000431: Unable to determine H2 database version, certain features may not work.

Can anybody tell me how to precise the H2 version ? Thanks.


persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  <persistence-unit name="jsr352" transaction-type="JTA">
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
    <class>org.hibernate.search.jsr352.test.entity.Company</class>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
      <property name="hibernate.show_sql" value="false" />
      <property name="hibernate.format_sql" value="false" />
      <property name="hibernate.hbm2ddl.auto" value="create-drop" />
      <property name="hibernate.search.default.directory_provider" value="ram" />
      <property name="hibernate.search.indexing_strategy" value="manual" />
    </properties>
  </persistence-unit>
</persistence>

The subsystem datasources in WF standalone.xml configuration.

<subsystem xmlns="urn:jboss:domain:datasources:4.0">
  <datasources>
    <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
      <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
      <driver>h2</driver>
      <security>
        <user-name>sa</user-name>
        <password>sa</password>
      </security>
    </datasource>
    <drivers>
      <driver name="h2" module="com.h2database.h2">
        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
      </driver>
    </drivers>
  </datasources>
</subsystem>

Upvotes: 4

Views: 6875

Answers (1)

stenix
stenix

Reputation: 3106

I got this issue when I specified to use org.hibernate.dialect.H2Dialect when I in fact was using HSQL with driver org.hsqldb.jdbcDriver. After changing to use org.hibernate.dialect.HSQLDialect the message went away.

This is not the case for you, you seems to use H2 so maybe the driver class is wrong? I would expect something like:

<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>

Upvotes: 1

Related Questions