Hi,
I have a hibernate project and I want to generate a change log using ant
and the hibernate mapping files. I fail with the error message appearing
below. The DB is MySQL.
The snippet from the ant build.xml:
<target name=“hibernate-changelog”
description=“Create a change log file for liquibase.”>
<diffDatabaseToChangeLog
referenceDriver=“com.mysql.jdbc.Driver”
url=“jdbc:mysql://localhost:3306/migtest”
referenceUrl=“hibernate:src/resources/hibernate.cfg.xml”
username="${username}"
password="${password}"
outputFile=“liquibase/changelog.xml”
classpathref=“lclasspath”/>
I have checked that I can connect to the database by other means: both
command line and using jdbc. So the user account in the database has
been set up correctly.
The MySQL logs show that an attempt was made to connect but there is
no information saying that access was denied.
The stacktrace shows that the method ‘createDatabaseObject’ in the
class liquibase.integration.ant.BaseLiquibaseTask.java cannot get a
connection.
More information below. Any help is greatly appreciated.
Thanks,
–
Ravi/
JDK 1.6.0_20
mysql: 5.1.15 (with matching jdbc driver)
liquibase.exception.DatabaseException: Connection could not be created to hibernate:src/resources/hibernate.cfg.xml with driver com.mysql.jdbc.Driver. Possibly the wrong driver for the given database URL
at liquibase.integration.ant.BaseLiquibaseTask.createDatabaseObject(BaseLiquibaseTask.java:241)
at liquibase.integration.ant.DiffDatabaseTask.execute(DiffDatabaseTask.java:98)
[ rest of stack trace deleted as it is standard ant stack. ]