A stumbling block galore when trying to run org.hibernate.tool.ant.EnversHibernateToolTask

I am trying to run org.hibernate.tool.ant.EnversHibernateToolTask ​​as suggested in a rather short guide to Envers (2nd row of the table, the documentation has a link to PDF). Here my ant task is changed so that it successfully finds org.hibernate.tool.ant.EnversHibernateToolTask ​​and org.hibernate.tool.ant.HibernateToolTask; now he cannot find org.apache.tools.ant.Task, and I have the feeling of immersion that I am doing something wrong.

<target name="schemaexport" depends="init"
        description="Exports a generated schema to DB and file">
<taskdef name="hibernatetool"
    classname="org.hibernate.tool.ant.EnversHibernateToolTask"
        classpath=".;C:\appl\Java\jre6u13\lib\ext\envers-1.2.0.ga-hibernate-3.3.jar;C:\appl\Java\jre6u13\lib\ext\hibernate-tools.jar" />
<!--classpathref="${schema.classpath}"/>-->
<hibernatetool destdir=".">
    <classpath>
        <fileset refid="lib.hibernate" />
        <path location="${build.dir}" />
    </classpath>
<jpaconfiguration persistenceunit="ConsolePU" />
<hbm2ddl
    drop="false"
    create="true"
    export="false"
    outputfilename="versioning-ddl.sql"
    delimiter=";"
    format="true"/>
</hibernatetool>
</target>

ant, , , - . - ? , classpath hibernatetool, javadoc.

: ok, Q, ...

  • jar org.apache.tools.ant.Task, ant ?
  • , HibernateToolTask? ( , EnversHibernateToolTask ​​ )

update (2009-06-18): , , , , . , :

  • ant schemaexport , Eclipse, my schemaexport. (ant Eclipse org/apache/tools/ant/Task , ant eclipse ( taskdef; ant classpath, damn, . .... grrr...)
  • , , JRE /lib/ext:

    • Envers-1.2.0.ga--3.3.jar
    • hibernate3.jar
    • -tools.jar
    • SLF4J-log4j12-1.5.6.jar
    • slf4j-api-1.5.6.jar
    • log4j-1.2.15.jar

:

C:\\\Java\- \build.xml: 61: JPA. hibernate EntityManager ?

[[[[[]]]]]

update ,

  • -entitymanager.jar
  • -annotations.jar

STILL :

BUILD FAILED
java.lang.NoClassDefFoundError: javax/persistence/PersistenceException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
        at java.lang.Class.getConstructor0(Class.java:2699)
        at java.lang.Class.newInstance0(Class.java:326)
        at java.lang.Class.newInstance(Class.java:308)
        at org.hibernate.tool.ant.JPAConfigurationTask.createConfiguration(JPACo
nfigurationTask.java:33)
        at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(Configurati
onTask.java:54)

J2EE-?!?!?!?!?!? JAR ? .

update (2009-06-23): - . , :

* envers-1.2.0.ga-hibernate-3.3.jar
* hibernate3.jar
* hibernate-tools.jar
* slf4j-log4j12-1.5.6.jar
* slf4j-api-1.5.6.jar 
* log4j-1.2.15.jar
* dom4j-1.6.1.jar
* hibernate-commons-annotations.ja
* a JAR containing JTA classes (Sun doesn't have a JAR file but you can download the [class files][3] yourself and make a JAR file out of it)
* a JAR containing JPA classes (I used toplink-essentials.jar from the glassfish project, per [this SO question][4])
* commons-logging-1.1.1.jar
* freemarker.jar

,

<annotationconfiguration configurationfile="${some_path}/hibernate.cfg.xml"/>

<jpaconfiguration>, ant. , .: (

+3
2

EnversHibernateToolTask ​​ HibernateToolTask. , , :

<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.EnversHibernateToolTask"
        classpath="envers-1.2.0.ga-hibernate-3.3.jar" />

ant, .

+1

ejb3--1.0.2.GA.jar

-2

Source: https://habr.com/ru/post/1709811/


All Articles