"HHH000431: Unable to determine H2 database version, certain features may not work" in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
    • 6
  • Hibernate
    • 5
    • 4

Issue

  • Using an H2 datasource (e.g. java:jboss/datasources/ExampleDS) for testing Hibernate

  • Encountering the warning below during deployment of a persistence unit

    ... WARN  [org.hibernate.dialect.H2Dialect] (...) HHH000431: Unable to determine H2 database version, certain features may not work
    

Resolution

This issue1 is resolved in This content is not included.EAP 7.3 cumulative patch (CP) 7 and later releases. Production systems should use the latest available cumulative patch.

NOTE: H2 is not supported for use in production environments.

Root Cause

The WARN event is logged due to a ClassNotFoundException raised when the H2 dialect Content from github.com is not included.attempts to access org.h2.engine.Constants using the class loader for the org.hibernate module which has no dependency on the com.h2database.h2 module in which the class is defined.

This is a known defect (This content is not included.WFLY-14474).

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.