-->
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.  [ 5 posts ] 
Author Message
 Post subject: Does hbm2ddl in Hibernate3 tools work?
PostPosted: Mon Sep 19, 2005 9:44 am 
Newbie

Joined: Thu Jun 03, 2004 7:02 am
Posts: 14
Location: UK
Hibernate version: 3.0.5
Hibernate Tools version: 3.1 alpha 5

Full stack trace of any exception that occurs:

java.lang.NoSuchMethodError: org.hibernate.tool.hbm2ddl.SchemaExport.setFormat(Z)Lorg/hibernate/tool/hbm2ddl/SchemaExport;

Hi,

I have a task in my build.xml which looks like this:

Code:
    <target name="generate">
      <hibernatetool destdir="bin">
            <configuration configurationfile="src/hibernate.cfg.xml" />

            <hbm2java />

            <hbm2ddl drop="false" outputfilename="${ant.project.name}.sql" />
        </hibernatetool>
    </target>


The hbm2java works perfectly (after downloading the velocity libs), but hbm2ddl fails with the exception noted above.

I notice that the Hbm2DDLGeneratorTask class imports org.hibernate.tool.hbm2ddl.SchemaExport and org.hibernate.tool.hbm2ddl.SchemaUpdate, neither of which exist in hibernate-tools.jar.

Should this be working? Are there changes I can make to get this working?

Thanks,

Phil


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 10:29 am 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
Those classes are in hibernate3.jar. SchemaExport is considered part of the core Hibernate library, and can be run (from your code) without the tools jar.

Make sure your h3 jar is in your classpath when running the ant task.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 11:11 am 
Newbie

Joined: Thu Jun 03, 2004 7:02 am
Posts: 14
Location: UK
Yes, you're right, thanks.

However, the exception is NoSuchMethodError.

SchemaExport.setFormat(param) is being called, but the method doesn't exist. The only similar method is SchemaExport.format(param) but I have no idea if that's what is actually intended, or where it's being called from.

Cheers,

Phil


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 11:21 am 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
I haven't upgraded to the alpha5 tools yet, but I think it requires H3.1.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 11:56 am 
Newbie

Joined: Thu Jun 03, 2004 7:02 am
Posts: 14
Location: UK
Ah yes, that looks like it's done the trick! Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.