-->
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.  [ 4 posts ] 
Author Message
 Post subject: cfg2cfgXml Hibernate3 Ant task generator not recognized?
PostPosted: Wed Aug 03, 2005 9:44 pm 
Beginner
Beginner

Joined: Mon Aug 01, 2005 3:10 pm
Posts: 22
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
Hibernate 3 Tools: 3.0.0.alpha4 for Ant tasks

Full stack trace of any exception that occurs:
BUILD FAILED
C:\dev\build.xml:68: The <hibernatetool> type doesn't support the nested "cfg2cfgXml" element.

Hi,

I am trying to generate the hibernate.cfg.xml file when reverse engineering from database schema to hibernate mappings and Java files.

Seems like the <cfg2cfgXml/> generator is not recognized by the HibernateToolTask taskdef in Ant.

Other generators run fine with Ant.

Also, generation of hibernate.cfg.xml works fine as part of the Eclipse plugin though. The problem seems to be in the Ant task alone.

Thanks,
Murtaza


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 4:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...are you sure the case is right and that you are using the correct .jars ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 2:01 pm 
Beginner
Beginner

Joined: Mon Aug 01, 2005 3:10 pm
Posts: 22
Hi,

I believe I am doing it correctly and referencing only the jars in the plugin dir of Eclipse Hibernate Tools 3.0 alpha4.

Here is the Ant build.xml with the <cfg2cfgXml/> commented out:

<?xml version="1.0"?>

<project name="biof_hib" basedir="." default="build">

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

<!-- define directories -->
<property name="config.dir" value="config"/>
<property name="output.dir" value="output"/>
<property name="lib.dir" value="lib"/>
<property name="docs.dir" value="docs"/>
<property name="dist.dir" value="dist"/>
<property name="hib3tools.root" value="C:\dev\ide\eclipse\plugins\org.hibernate.eclipse_3.0.0.alpha4\lib"/>

<!-- define external properties -->
<!--<property file="build.properties"/>-->

<!-- define CLASSPATH for the Hibernate Tool -->
<path id="hib3tools-classpath">
<fileset dir="${hib3tools.root}">
<include name="hibernate3.jar"/>
<include name="hibernate-tools.jar"/>
<include name="velocity-*.jar"/>
<include name="velocity-tools-generic-*.jar"/>
<include name="jtidy-*.jar"/>
<include name="commons-logging-*.jar"/>
<include name="dom4j-*.jar"/>
<include name="ehcache-*.jar"/>
<include name="commons-collections-*.jar"/>
<!--<include name="*.jar"/>-->
</fileset>
<fileset dir="${lib.dir}">
<include name="mysql-connector-java-*.jar"/>
</fileset>
</path>

<!-- define a "hibernatetool" task -->
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
>
<classpath refid="hib3tools-classpath"/>
</taskdef>

<target name="usage">
<echo message=""/>
<echo message="Hibernate 3 Tools DB to Java build file"/>
<echo message="------------------------------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="clean --> Clean output dirs"/>
<echo message="build --> Reverse generate Java DAO files and mappings"/>
<echo message="docs --> Create complete Javadoc documentation"/>
<echo message="all --> All"/>
<echo message=""/>
</target>

<target name="clean" description="Clean">
<delete dir="${output.dir}"/>
<delete dir="${docs.dir}"/>
</target>

<target name="build" description="Generate files and mappings">
<mkdir dir="${output.dir}"/>
<mkdir dir="${output.dir}/docs"/>

<hibernatetool destdir="${output.dir}">
<!-- specify jdbc configuration -->
<jdbcconfiguration
configurationfile="${config.dir}/hibernate.cfg.xml"
packagename="nextbio"
/>

<!-- generate mapping files (WORKS) -->
<cfg2hbm/>

<!-- generate Java DAO files (WORKS) -->
<hbm2java/>

<!-- generate hibernate configuratin file (DOES NOT WORK?) -->
<!--<cfg2cfgXml/>-->

<!-- generate documentation (WORKS) -->
<hbm2doc destdir="${output.dir}/docs"/>
</hibernatetool>

</target>

<target name="all" depends="clean,build" description="All"/>

</project>


Top
 Profile  
 
 Post subject: Re: cfg2cfgXml Hibernate3 Ant task generator not recognized?
PostPosted: Thu Oct 08, 2009 4:49 pm 
Newbie

Joined: Thu Oct 08, 2009 4:43 pm
Posts: 2
Hi,

Did you solved the problem?
I have same problem, but I can solve this situation.

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.