-->
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: org.hibernate.MappingException: Error reading resource
PostPosted: Fri Jun 03, 2005 9:53 am 
Newbie

Joined: Fri Sep 24, 2004 5:00 am
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

Mapping documents:hello/Category.hbm.xml

Full stack trace of any exception that occurs:
Exception in thread "main" org.hibernate.MappingException: Error reading resourc
e: hello/Category.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:433)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1213)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1169)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1097)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1083)
at console.ConsoleRunner.getSessionFactory(ConsoleRunner.java:28)
at console.ConsoleRunner.persistMessage(ConsoleRunner.java:12)
at console.ConsoleRunner.main(ConsoleRunner.java:34)
Caused by: org.hibernate.MappingException: duplicate import: hello.Category
at org.hibernate.cfg.Mappings.addImport(Mappings.java:100)
at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:153)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:426)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:1848)
at org.hibernate.cfg.Configuration.add(Configuration.java:344)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:382
)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:430)
... 7 more



Name and version of the database you are using:MySQL

_________________
regards
-Ranjan
ranjanbaisak@yahoo.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 7:32 am 
Newbie

Joined: Fri Sep 24, 2004 5:00 am
Posts: 5
The problem was if mapping gile and POJO resides in the same directory then it gives duplicate import problem or error reading mapping xml file.
I realised this after moving the mapping file to a different package.

_________________
regards
-Ranjan
ranjanbaisak@yahoo.com


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.