anthbm2ddlhibernate-tools

hbm2dll java.lang.ExceptionInInitializerError


I'm trying to use the ant taks hbm2dll but every time I try to execute it, I have a java.lang.ExceptionInInitializerError.

Here's my ant task:

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="generatePath"/>
<!-- copy hibernate properties file into generated.path -->
<copy todir="${basedir}/${output.path}/${generated.path}/classes" file="${basedir}/${input.path}/${data-model.path}/hibernate.properties"/>

<hibernatetool destdir="${basedir}/${output.path}/${generated.path}/classes">
    <jpaconfiguration persistenceunit="${data-model-package}.dm_${data-model-version}"/>
    <classpath>
        <path location="${basedir}/${output.path}/${generated.path}/classes" />
    </classpath>

    <property key="default-cascade" value="save-update"/>
    <property key="defaultcascade" value="save-update"/>

    <hbm2ddl
        drop="false"
        create="true"
        export="false"
        outputfilename="../../${sql-scripts.path}/MySQLScript.sql"
        delimiter=";"
        format="false"/>

    <hbm2cfgxml ejb3="false"/>
    <hbm2hbmxml/>
</hibernatetool>

And my error output is:

 [exec] [hibernatetool] Executing Hibernate Tool with a JPA Configuration
 [exec] [hibernatetool] 1. task: hbm2ddl (Generates database schema)
 [exec]
 [exec] BUILD FAILED
 [exec] MY/PATH/TO/XML/FILE.xml:10: java.lang.ExceptionInInitializerError

Does someone have an idea?

Thanks !


Solution

  • ant-contrib-0.6 jar was missing in the classpath