-->
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.  [ 4 posts ] 
Author Message
 Post subject: Cant read mappings from my mapping file
PostPosted: Tue Nov 29, 2005 6:41 am 
Newbie

Joined: Tue Nov 29, 2005 6:33 am
Posts: 6
When i try to run a hibernate application it shows the following error:

'Error while reading mappings from resource : login.hbm.xml'

i having the following files:

1.hibernate.cfg.xml - hibernate config.file.
2.Login.java - a bean file.
3.Login.hbm.xml - mapping file for 'login' table
4.Checking - file which contains 'main' class.

is it necessary to create a separeate folder like src,bin for our applications.

thank you


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 6:48 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Can you post login.hbm.xml and hibernate.cfg.xml ?

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 8:45 am 
Regular
Regular

Joined: Sat Nov 05, 2005 5:33 am
Posts: 70
Location: Linz, Austria
And most of all a full stack trace.
Normally there is more information in the exception that caused the error.

Heinz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 2:39 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
the value of the resource attribute of the mapping element in the file hibernate.cfg.xml must be equal to the classpath location of the mapping file.

Code:
<mapping resource="com/foo/login.hbm.xml" />


... where com/foo (9 times out of 10 on this forum) will be under /WEB-INF/classes .


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