Null pointer exception in JdbcDatabaseSnapshotGenerator

First I would just like to say what a great tool liquibase is. Seems to have so much functionality, and looks like it will do exactly what we want.

I am having a small issue with the hibernate integration. I noticed that you split the hibernate aspect of liquibase into separate extension jar file in v2. I guess the documentation is a little out of date. Anyway having downloaded that, I now get a little further. The output I now get is

D:\apps\liquibase-2.0.1-bin>java -jar liquibase.jar --logLevel=debug diff
DEBUG 14/02/11 12:46:liquibase: Unable to load/access Apache Derby driver class to check version:
DEBUG 14/02/11 12:46:liquibase: Connected to XTS_CHRIS@jdbc:oracle:thin:@asus4:1
WARNING 14/02/11 12:46:liquibase: Unknown database: Hibernate
DEBUG 14/02/11 12:46:liquibase: Reading tables for unsupported Database …
INFO 14/02/11 12:46:liquibase: Reading tables for unsupported Database …
Liquibase Update Failed: Unknown Reason
SEVERE 14/02/11 12:46:liquibase: Unknown Reason
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readTables(JdbcD
        at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(J
        at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(Da
        at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLine
        at liquibase.integration.commandline.Main.doMigration(
        at liquibase.integration.commandline.Main.main(

Looking into the source code, I am a little confused. liquibase.ext.hibernate.database.HibernateDatabase.getConnection always returns null. liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot obtains a DatabaseMetaData and then passes to readTables. My take on the getMetaData method is that it will always return null, hence fail for a hibernate driver. So it appears to me that something must have changed in this area, or I am doing something wrong.

I’d love to hear you opinion on this



(sorry for the delay, was on vacation)

I’m glad liquibase is working well for you in general.  

Yes, we did split out the hibernate integration as part of 2.0 and the doc does need to be updated. Have not had the time lately I would like…

There is a HibernateDatabaseSnapshotGenerator that should be being used.  I’ll have to look more into why it is not.


Has the issue ever been fixed? I’m seeing the same exception with liquibase 2.0.1 and hibernate extension 2.0.0.

I haven’t gotten a chance to look at it yet, unfortunately. I did create to track the issue.