-->
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: cfg.Mappings error
PostPosted: Thu Sep 01, 2005 5:58 pm 
Newbie

Joined: Wed May 12, 2004 5:09 pm
Posts: 17
Location: Los Angeles
Hello,

I'm using 3.1beta4 and getting java.lang.NoSuchMethodError: org.hibernate.cfg.Mappings...

There are a few posts about this error, and one says annotations work only with 3.1 beta 1. However, that is NOT available for download!
I've tried 3.0 beta 1 and it doesn't work either.

So what is the version I shoud use to get annotations working and where do I get it?
_____________

All I'm trying to do is generate java. My build.xml:

<hibernatetool destdir="${gen.dst}">
<annotationconfiguration configurationfile="hibernate.cfg.xml"/>
<hbm2java/>
</hibernatetool>

Does this look right? And my hibernate.cfg.xml:

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">..</property>
<property name="hibernate.connection.url">...</property>
<property name="hibernate.connection.username">...</property>
<property name="hibernate.connection.password">...</property>
<property name="hibernate.dialect">...</property>

<mapping package="com.umusic.ecrm.db.orcl"/>
<mapping class="com.umusic.ecrm.db.orcl.DmBogus"/>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 7:11 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate core 3.1beta1 is available for download in sourceforge.net

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Link to 3.1 beta1?
PostPosted: Thu Sep 01, 2005 7:19 pm 
Newbie

Joined: Wed May 12, 2004 5:09 pm
Posts: 17
Location: Los Angeles
As I said, 3.1 beta 1 is NOT available for download:

http://sourceforge.net/project/showfile ... _id=139933

Please provide a link where to download it from if you know. Thanks--


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 01, 2005 7:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
As I said, Hibernate core is, not annotations. And that's what you need, that's what's referenced in the post you've seen.
core 3.1beta1 and annotations 3.1beta4.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: org.hibernate.MappingException
PostPosted: Thu Sep 01, 2005 7:56 pm 
Newbie

Joined: Wed May 12, 2004 5:09 pm
Posts: 17
Location: Los Angeles
Thank you, Emmanuel!

Now it runs, but I'm sure I don't know how to use it. I'm trying to run annotationconfiguration with hbm2java task, to generate annotated java.

I've given it the name of the class I want it to create annotated, and it gives me:

org.hibernate.MappingException: Unable to load class declared as <mapping class="com.umusic.ecrm.db.orcl.DmBogus"/> in the configuration:

So it assumes the class must exist? I thought annotations is a way to use hibernate without the .hbm.xml file, i.e. producing java without xml. Maybe I should use some task other that hbm2java? (I didn't know what else to use)?

If it actually expects the class to exist, how am I supposed to create it - with jdbcconfiguration? But then I'd HAVE to create .hbm.xml, which is exactly what I'm trying to avoid.

Thank you in advance for your help!

Egor


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.