-->
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.  [ 7 posts ] 
Author Message
 Post subject: Cannot reverse engineer DB with hbm2hbmxml
PostPosted: Mon Jan 16, 2006 4:50 pm 
Newbie

Joined: Fri Jan 13, 2006 2:13 pm
Posts: 4
Location: Alpharetta, GA
Hi all,

I am trying to reverse engineer the DB and produce my .hbm.xml files using ant.
Here is my latest (of many) version of build.xml:

Code:
<project basedir="." name="MyBooks" default="compile">

    <property name="sourcedir" value="${basedir}/src"/>
    <property name="targetdir" value="${basedir}/bin"/>
    <property name="librarydir" value="${basedir}/lib"/>

    <path id="libraries">
        <fileset dir="${librarydir}">
            <include name="*.jar"/>
        </fileset>
    </path>

    <target name="clean">
        <delete dir="${targetdir}"/>
        <mkdir dir="${targetdir}"/>
    </target>

    <target name="compile" depends="clean, copy-resources, generate_files">
      <javac destdir="${targetdir}">
        <src path="${sourcedir}"/>     
             <classpath refid ="libraries"/>
      </javac>
    </target>

    <target name="copy-resources">
        <copy todir="${targetdir}">
            <fileset dir="${sourcedir}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>    
    </target>

   <taskdef
     name="hibernatetool"
     classname="org.hibernate.tool.ant.HibernateToolTask"
     classpathref="libraries"/>

    <target name="generate_files">
        <hibernatetool>
   
          <jdbcconfiguration configurationfile="hibernate.cfg.xml"/>
   
          <destdir="${sourcedir}/xml"/>

        </hibernatetool>
    </target>
          
</project>


I get the following error:

C:\Projects\Hibernate\MyBooks\build.xml:64: The <hibernatetool> type doesn't support the nested "hbm2hbmxml" element.

Any ideas?

Thanks,

Howard


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 5:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
your exception does not match the build file you have shown.

There is no hbm2hbmxml.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 6:07 pm 
Newbie

Joined: Fri Jan 13, 2006 2:13 pm
Posts: 4
Location: Alpharetta, GA
Sorry about that. I must have deleted it when cleaning out commented sections. It is:

Code:
<project basedir="." name="Hibe" default="compile">

    <property name="sourcedir" value="${basedir}/src"/>
    <property name="targetdir" value="${basedir}/bin"/>
    <property name="librarydir" value="${basedir}/lib"/>

    <path id="libraries">
        <fileset dir="${librarydir}">
            <include name="*.jar"/>
        </fileset>
    </path>

    <target name="clean">
        <delete dir="${targetdir}"/>
        <mkdir dir="${targetdir}"/>
    </target>

    <target name="compile" depends="clean, copy-resources, generate_files">
      <javac destdir="${targetdir}">
        <src path="${sourcedir}"/>     
             <classpath refid ="libraries"/>
      </javac>
    </target>

    <target name="copy-resources">
        <copy todir="${targetdir}">
            <fileset dir="${sourcedir}">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>    
    </target>

   <taskdef
     name="hibernatetool"
     classname="org.hibernate.tool.ant.HibernateToolTask"
     classpathref="libraries"/>

<target name="generate_files">
    <hibernatetool>
   
      <jdbcconfiguration configurationfile="hibernate.cfg.xml"/>
   
   <hbm2hbmxml  destdir="${sourcedir}/xml"/>

    </hibernatetool>

</target>
          

</project>
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 6:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - are you sure you are using the latest/greatest ? hbm2hbmxml were not there in the inital versions...but that is really a long time ago...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 10:26 am 
Newbie

Joined: Fri Jan 13, 2006 2:13 pm
Posts: 4
Location: Alpharetta, GA
I downloaded "org.hibernate.eclipse_3.1.0.alpha5.jar" and installed in the lib directory of the project. When I encountered my initial problems, I unjarred the .jar file and placed the following files directly in the lib folder:

1. hibernate-tools.jar
2. jtidy-r8-21122004.jar
3. velocity-1.4.jar
4. velocity-tools-generic-1.1.jar

I already had hibernate3.jar and my drivers there.

The structure looks like this:
MyProject
-lib
----hibernate-tools.jar
----jtidy-r8-21122004.jar
----velocity-1.4
----velocity-tools-generic-1.1.jar
----hibernate3.jar
----drivers, etc.

-src

-hibernate.cfg.xml

-build.xml

What do you think?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 17, 2006 6:16 pm 
Regular
Regular

Joined: Sat Nov 06, 2004 5:20 pm
Posts: 54
Location: Collierville, TN
If you are using ANT inside Eclipse then you'll need to "tell ANT where to find the hibernate-tools.jar". This is done by:
Code:
clicking Window, Preferences..., Ant, Runtime, Ant Home Entries, then click Add External Jars...

If you are using Ant commandline then I think you can specify the jar using -lib <path>.

Hope this helps.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 3:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use something more recent than alpha5! ;)

_________________
Max
Don't forget to rate


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