-->
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.  [ 2 posts ] 
Author Message
 Post subject: Regarding Duplication in Mapping files
PostPosted: Thu Apr 06, 2006 5:44 am 
Newbie

Joined: Wed Feb 15, 2006 6:32 am
Posts: 2
Is it possible to have two mapping files using the same POJO
bcoz im getting the error duplicate class mapping. Im referring to the same java Object in two mapping files

Code:
log4j:WARN No appenders could be found for logger (com.tcs.pdn.dataservices.order.Impl.reviewImpl).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
   at com.tcs.pdn.dataservices.common.HibernateUtil.<clinit>(HibernateUtil.java:24)
   at com.tcs.pdn.dataservices.order.dao.ORDOrderDAO.getSessionFactory(ORDOrderDAO.java:52)
   at com.tcs.pdn.dataservices.order.dao.ORDOrderDAO.<init>(ORDOrderDAO.java:47)
   at com.tcs.pdn.dataservices.order.Impl.TestImpl.saveOrder(TestImpl.java:64)
   at com.tcs.pdn.dataservices.order.Impl.TestImpl.main(TestImpl.java:596)
Caused by: org.hibernate.MappingException: Could not read mappings from resource: com/tcs/pdn/dataservices/order/mapping/PpaPortfolioPositions.hbm.xml
   at org.hibernate.cfg.Configuration.addResource(Configuration.java:476)
   at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1414)
   at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1382)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1363)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1339)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:1259)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:1245)
   at com.tcs.pdn.dataservices.common.HibernateUtil.<clinit>(HibernateUtil.java:18)
   ... 4 more
Caused by: org.hibernate.MappingException: duplicate class mapping: com.tcs.pdn.to.order.PPAPortfolioPositionTO
   at org.hibernate.cfg.Mappings.addClass(Mappings.java:96)
   at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:111)
   at org.hibernate.cfg.Configuration.add(Configuration.java:379)
   at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:418)
   at org.hibernate.cfg.Configuration.addResource(Configuration.java:473)
   ... 11 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 06, 2006 6:41 am 
Regular
Regular

Joined: Tue Nov 29, 2005 12:31 pm
Posts: 75
Hi,

Yes, it can be done. Just make sure, as your error message is telling you, that you don't duplicate your mappings. It's enought if you define it in only one hbm file.

If more help is needed post your mapping files and you hibernate.cfg.xml file.


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