-->
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.  [ 3 posts ] 
Author Message
 Post subject: Duplicate Mapping Exception
PostPosted: Wed Jan 20, 2010 1:55 pm 
Newbie

Joined: Fri Jan 15, 2010 1:22 pm
Posts: 5
Hi everyone,

I get the following exception when trying to run my app:
Code:
javax.persistence.PersistenceException: [PersistenceUnit: Pizzeria2PU] Unable to configure EntityManagerFactory

...

Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping entity.Kundebestellung.gerichten



I googled but didn't find any solution to my problem. I don't have any .hbm.xml duplicates (or duplicates in the cfg file), i did not forget to add all the properties in the mapping files. Everything seems to be ok. What else could be wrong?

Thanks.


Top
 Profile  
 
 Post subject: Re: Duplicate Mapping Exception
PostPosted: Wed Jan 20, 2010 2:10 pm 
Newbie

Joined: Fri Jan 15, 2010 1:22 pm
Posts: 5
Ok, you know how it is, when you search for an answer , you don't find it, then you post a message somewhere on a forum, and 2 minutes later you find the solution...

The problem was that I forgot to write in the mapping file of a class
Code:
<generator class="increment"/>


That was it.


Top
 Profile  
 
 Post subject: Re: Duplicate Mapping Exception
PostPosted: Thu Jan 21, 2010 9:46 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Yeah, that's always the way, isn't it. Thanks for the postback! It'll help everyone else now.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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