【问题标题】:hbm2dll java.lang.ExceptionInInitializerErrorhbm2dll java.lang.ExceptionInInitializerError
【发布时间】:2016-11-06 05:51:13
【问题描述】:

我正在尝试使用 ant taks hbm2dll,但每次尝试执行它时,我都会遇到 java.lang.ExceptionInInitializerError。

这是我的蚂蚁任务:

<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>

我的错误输出是:

 [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

有人有想法吗?

谢谢!

【问题讨论】:

    标签: ant hbm2ddl hibernate-tools


    【解决方案1】:

    类路径中缺少 ant-contrib-0.6 jar

    【讨论】:

      猜你喜欢
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      • 2018-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多