-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 4 ant problem
PostPosted: Sat Mar 03, 2012 2:11 pm 
Newbie

Joined: Sat Mar 03, 2012 4:10 am
Posts: 1
After upgrading my app to Hibernate 4, my ant task doesn't work for recreating my datasource:

Code:
[hibernatetool] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration

[hibernatetool] 1. task: hbm2ddl (Generates database schema)

[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generates database schema)

[hibernatetool] To get the full stack trace run ant with -verbose

[hibernatetool] Problems in creating a AnnotationConfiguration. Have you remembered to add it to the classpath ?


Here's my build snippet:

Code:
<target name="createSchema" description="Creates tablecreation- and tabledropscript" depends="init, createConfig, build-domain.jar">
        <path id="toolslib">
           
            <fileset dir="../compile-libs">
                <include name="hibernate/hibernate-envers-*.jar" />
                <include name="hibernate/hibernate-core-*.jar" />
                <include name="hibernate/hibernate-tools.jar" />
                <include name="hibernate/hibernate-jpa-*.jar" />
                <include name="hibernate/freemarker.jar" />
                <include name="xdoclet/commons-collections-3.2.jar" />
                <include name="xdoclet/commons-logging.jar" />
                <include name="jaxb/jaxb-impl.jar" />
            </fileset>

            <pathelement location="${component.domain.dir.dd}" />
            <pathelement location="${component.domain.dir.classes}" />

            <fileset dir="../lib">
                <include name="javaee/jee-5/javaee.jar" />
                <include name="dom4j.jar" />
                <include name="slf4j-api-*.jar" />
                <include name="slf4j-log4j12-*.jar" />
                <include name="trias/Questionnaire-*.jar" />
                <include name="trias/Trias-*.jar" />
                <include name="trias/Processing-*.jar" />
                <include name="trias/RAISExecutionFramework-*.jar" />
                <include name="trias/HLRLifeProcessing-*.jar" />
                <include name="trias/bpDataTypes-*.jar" />
                <include name="trias/i18ntext-*.jar" />
            </fileset>
        </path>
       
        <apply executable="test" type="file" ignoremissing="false">
            <arg value="-e"/>
            <srcfile/>
            <path refid="toolslib"/>
        </apply>
       
        <property name="myclasspath" refid="toolslib"/>
                        <!-- Emit the property to the ant console -->
        <echo message="Classpath = ${myclasspath}"/>
       
        <available
              property="hibernatetoolok"
              classname="org.hibernate.tool.ant.EnversHibernateToolTask"
              classpathref="toolslib" />

        <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.EnversHibernateToolTask" classpathref="toolslib"/>

        <mkdir dir="../database/generated" />

        <property name="prefix" value="" />

        <echo message="used config file = ${project.dir.conf}/hibernate/${prefix}hibernate.cfg.xml"/>
        <hibernatetool destdir="../database/generated">
            <classpath>
                <path refid="toolslib"/>
            </classpath>   
            <annotationconfiguration configurationfile="${project.dir.conf}/hibernate/${prefix}hibernate.cfg.xml" />
            <hbm2ddl export="false" update="false" drop="false" create="true" delimiter=";" format="true" outputfilename="${prefix}myapp-create.ddl.sql" />
            <hbm2ddl export="false" update="false" drop="true" create="false" delimiter=";" format="true" outputfilename="${prefix}myapp-drop.ddl.sql" />
        </hibernatetool>
    </target>



Any ideas what's wrong with my build.xml?


Top
 Profile  
 
 Post subject: Re: Hibernate 4 ant problem
PostPosted: Mon Mar 05, 2012 3:02 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi,

for the moment there's no official Hibernate-Tools version available compatible with Hibernate4
For more infos see:
https://forum.hibernate.org/viewtopic.php?f=6&t=1014366


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.