where hibernate.cfg.xml is the one from the CONTRIB directory. This yields:
Liquibase Update Failed: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:./hibernate/hibernate.cfg.xml)
liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:./hibernate/hibernate
.cfg.xml)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:77)
at liquibase.integration.commandline.Main.doMigration(Main.java:599)
at liquibase.integration.commandline.Main.main(Main.java:105)
Caused by: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:./hibernate/hibernate.cfg.xml)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:58)
... 2 more
C:\Sabre\Dev\liquibase-2.0-rc2-bin>liquibase --logLevel DEBUG --url=jdbc:oracle:thin:@connection --username=USER --password=PASS --driver=oracle.jdbc.OracleDriver --changeLogFile=ch.xml diffChangeLog --referenceUrl=hibernate:hibernate/Hibernate.cfg.xml
Liquibase Update Failed: org.dom4j.DocumentException
Jul 14, 2010 3:03:18 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: org.dom4j.DocumentException
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at liquibase.ext.hibernate.database.HibernateDatabase.createConfiguration(HibernateDatabase.java:360)
at liquibase.ext.hibernate.snapshot.HibernateDatabaseSnapshotGenerator.createSnapshot(HibernateDatabaseSnapshotGenerator.java:70)
at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69)
at liquibase.diff.Diff.compare(Diff.java:65)
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:97)
at liquibase.integration.commandline.Main.doMigration(Main.java:609)
at liquibase.integration.commandline.Main.main(Main.java:105)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
I’m not sure if I’m facing the same problem. I have all parts in my classpath, but liquibase keeps failing to find the hibernate config.
phurrelmann@ws1:trunk/logic$ java -jar tools/liquibase.jar --classpath=lib/hibernate3.jar:tools/hibernate-annotations.jar:tools/hibernate-commons-annotations.jar:lib/hibernate3.jar:tools/liquibase-hibernate-2.0.jar:tools/postgresql-8.4-701.jdbc3.jar:lib/dom4j-1.6.1.jar:lib/slf4j-log4j12-1.5.10.jar:lib/slf4j-api-1.5.10.jar:lib/log4j-1.2.15.jar:lib/commons-logging-1.1.1.jar --logLevel=DEBUG --url=jdbc:postgresql://localhost:5432/test --username=test --password=test --driver=org.postgresql.Driver --changeLogFile=changelog.xml diffChangeLog --referenceUrl=hibernate:src/hibernate.cfg.xml
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
Liquibase Update Failed: src/hibernate.cfg.xml not found
Jul 14, 2010 4:59:03 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: src/hibernate.cfg.xml not found
liquibase.exception.DatabaseException: org.hibernate.HibernateException: src/hibernate.cfg.xml not found
at liquibase.ext.hibernate.snapshot.HibernateDatabaseSnapshotGenerator.createSnapshot(HibernateDatabaseSnapshotGenerator.java:216)
at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(DatabaseSnapshotGeneratorFactory.java:69)
at liquibase.diff.Diff.compare(Diff.java:65)
at liquibase.integration.commandline.CommandLineUtils.doDiffToChangeLog(CommandLineUtils.java:97)
at liquibase.integration.commandline.Main.doMigration(Main.java:609)
at liquibase.integration.commandline.Main.main(Main.java:105)
Caused by: org.hibernate.HibernateException: src/hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:972)
at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:69)
at liquibase.ext.hibernate.snapshot.HibernateDatabaseSnapshotGenerator.createSnapshot(HibernateDatabaseSnapshotGenerator.java:71)
... 5 more
The same error happens when using the ant-task. Is there anything I can do to further debug this?
I also tried the latest build from the build-server, but it seems to be way out of date (11. june).
Originally posted by: Nathan
phurrelmann: try adding "src" to your classpath and referencing your file as just --referenceUrl=hibernate:hibernate.cfg.xml