0 Replies Latest reply on Mar 3, 2012 1:12 PM by Martin Reinhardt

    Hibernate 4 ant problem after upgrade to JBoss 7.1

    Martin Reinhardt Newbie

      After upgrading my app to JBoss 7.1, my ant task doesn't work for recreating my datasource:

       

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

       

       

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