-->
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.  [ 9 posts ] 
Author Message
 Post subject: hbm2java with hibernate3
PostPosted: Thu Aug 03, 2006 12:07 pm 
Newbie

Joined: Mon Jun 19, 2006 2:34 pm
Posts: 8
Is there a new version of hbm2java to use with Hibernate 3.0?

I downloaded Hibernate Extensions 2.1.3 from this link:

http://sourceforge.net/project/showfile ... e_id=85666

And using the example on Page 363 in Hibernate In Action I use a taskdef that uses this class:

net.sf.hibernate.tool.hbm2java.Hbm2JavaTask

When I run this I get the below exception. In hibernate3.jar the MappingException class is in the org.hibernate package (org.hibernate.MappingException). I am guessing I don't have the right version of hbm2java to use with Hibernate 3.x. But I sure haven't been able to find a 3.x version of it.

Caused by:
java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:93)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)

at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:149)
at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:93)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)

at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:97)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 12:35 pm 
Newbie

Joined: Mon Jun 19, 2006 2:34 pm
Posts: 8
Ok, I found them. Apparently if you just want to use the ANT tasks you still have to download a 33.1 MB Hibernate-Tools package just to obtain a 279K jar file. Then navigate to:

plugins/org.hibernate.eclipse_3.2.0.beta6a/lib/tools

and there is the new hibernate-tools.jar file.

Because downloading a package that seems targeted to Eclipse so I can obtain the ANT task so I can use it through Intellij <sarcasm>makes perfect sense</sarcasm>.

How about just making hibernate-tools.jar available as a standalone download?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 03, 2006 3:45 pm 
Newbie

Joined: Mon Jun 19, 2006 2:34 pm
Posts: 8
Ok, so to use the hibernatetool ANT task you also need the hibernate3.jar that comes bundled with hibernate tools and NOT the hibernate3.jar that comes bundeled with Hibernate itself. This has made for a very frustrating day and this is simply stupid.

How about updating this link with the information that you also need hibernate3.jar from the hibernate tools package (vs the one that comes with core)?

http://www.hibernate.org/hib_docs/tools ... l/ant.html



Not everyone uses Eclipse.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 04, 2006 10:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
You are very welcome to come on board and help maintain seperate packages and explain people which ones you have to download :)

I'll update the docs to be even more specific about the fact that the tools are dependent on the core and the version included in the tools (which currently is a hibernate 3.2 core) is the easiest option to use.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 5:20 pm 
Newbie

Joined: Mon Jun 19, 2006 2:34 pm
Posts: 8
Yeah, just a quick note at the top of the page I linked to mentioning that to use the ANT tasks standalone you need to use hibernate3.jar and that comes in the Hibernate Tools package would probably really help people. I found a couple of other posts from people that had the same issue.

When I wrote all that I had spent a good portion of the day troubleshooting that so I was quite frustrated by the time I posted...I guess that came through in the post...sorry about that:-)


Top
 Profile  
 
 Post subject: Hibernate tools...
PostPosted: Sat Mar 24, 2007 3:05 pm 
Newbie

Joined: Thu May 26, 2005 7:25 am
Posts: 13
Yap people, that's insane... someone with a deeper knoledgement than myself should try to make clear how to use the ant tasks from outside eclipse...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 24, 2007 4:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
The docs states where the jars are and how they are used in the taskdefs.

patches to the documentation to make things clearer are always appreciated.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 2:00 pm 
Newbie

Joined: Wed Apr 04, 2007 1:56 pm
Posts: 5
Location: Boston Area
I was getting this error when I accidentally had mapping turned on in my hibernate.cfg.xml file.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 2:03 pm 
Newbie

Joined: Wed Apr 04, 2007 1:56 pm
Posts: 5
Location: Boston Area
Sorry, this post was meant for another response - got mangled up when I registered...


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