I'm using a H2 database (H2 1.2.127) together with eclipse galileo and
hibernate (Hibernate Tools 3.2.4). When I try to launch a hibernate
code generation from the database on eclipse, I get the following
error (actual filename has been replaced by tag <filename>):
org.hibernate.exception.GenericJDBCException: Getting database
metadata
Getting database metadata
org.h2.jdbc.JdbcSQLException: Unsupported database file version or
invalid file header in file <filename> [90048-120]
Unsupported database file version or invalid file header in file
<filename> [90048-120]
org.h2.jdbc.JdbcSQLException: Unsupported database file version or
invalid file header in file <filename>[90048-120]
Unsupported database file version or invalid file header in file
<filename> [90048-120]
FYI, here is my hibernate.cfg.xml (actual database filename also
replaced by <filename>):
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property
name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property
name="hibernate.connection.driver_class">org.h2.Driver</property>
<property name="hibernate.connection.url">jdbc:h2:<filename></
property>
<property name="hibernate.connection.username">sa</property>
<property
name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
</session-factory>
</hibernate-configuration>
I do not understand why there is a problem with the database file,
because everything works fine when I open it from the H2 Console.
Does anyone have any ideas of what could cause this error?
Thanks in advance,
Vincent
> I'm using a H2 database (H2 1.2.127)
> Unsupported database file version or invalid file header in file <filename> [90048-120]
Most likely the problem is that you created the database with version
1.2.127, but Hibernate is still using version 1.2.120. H2 encodes the
build number in the exception message. "-120" means the exception is
from version 1.2.120.
Regards,
Thomas