• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Hibernate DuplicateMappingException

 
Ranch Hand
Posts: 37
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I am new to Hibernate. I am implementing Hibernate using JPA. Since i am using JPA there is no .cfg.xml or .hbm.xml file in my configuration(those files were present before but i deleted them). Even though there is no mapping file my classes i am getting exception for one of my login.OwnerLogin class org.hibernate.DuplicateMappingException: Duplicate class/entity mapping login.OwnerLogin. Even in my persistence .xml there is no mapping. Can anyone please tell me the cause of the following exception



and my persistence.xml file is as follows

 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You apparently have some other configuration file somewhere. You are getting warnings like the ones I listed below and those namespaces are not used in the persistence.xml you have listed:



My guess is somewhere in there exists a duplicate mapping for OwnerLogin.


I thought you said you don't have any hbm.xml files?




You might want to clean out your webapp directory and verify that the files you deleted are really gone in the WAR you are deploying.
 
Amit Goda
Ranch Hand
Posts: 37
Netbeans IDE Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply.

As you said my application is referencing unknown files, you are correct. Before posting i removed all the traces for the hbm and cfg files. I even cleared the cache from eclipse in case if its referencing from there and also i disabled caching but still had the problem. I even deleted the WAR file and deployed new one. But what i didn't do is clearing it from the webapps directory from where it is being referenced.

You are absolutely correct. I had those files present in my webapps directory. Thank you for pointing in the right direction. You were of great help.


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic