-->
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.  [ 5 posts ] 
Author Message
 Post subject: MappingException: resouce Days.hbm.xml not found
PostPosted: Tue Mar 28, 2006 3:33 am 
Newbie

Joined: Fri Mar 17, 2006 7:00 am
Posts: 5
Hi

I have created whole project exactly like it was described in the tutorial. I created porper configuration file hibernate.cfg.xml and hibernate.reveng.xml. I created hibernate console configuration and I was able to generate Days.java and Days.hbm.xml files which are correct. In the hibernate.cfg.xml file appeared new line:

Code:
<mapping resource="pcg/Days.hbm.xml" />

where pcg is Days class package.

The problem is when I refreshed the hibernate configuration view I got error:
Code:
Error while fetching children

Reason: org.hibernate.MappingException: Resource: pcg/Days.hbm.xml not found.

I don't understand, in my project I have JavaSource directory where I keep hibernate.cfg.xml file. In this directory there is pcg folder in which there are the fallowing files:

Days.java
Days.hbm.xml

so the path in resource element: pcg/Days.hbm.xml is absolutely correct. What is wrong here?

Regards,


Ania
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 4:19 am 
keep the htm.xml file in runtime classpath of your application/server

Hope this helps...

RCP


Top
  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 4:20 am 
keep the hbm.xml file in runtime class path of your application/server

Hope this helps..

RCP


Top
  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 5:35 am 
Newbie

Joined: Fri Mar 17, 2006 7:00 am
Posts: 5
Yes that helped, thanks a lot - by the way it's strange that I have to pack my files into jar file and put it into lib dir - strange that eclipse can't see them when they are in bin dir - I would never suspect that this is the reason of errors I got.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 3:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you are talking about how to tell the console configuration about your resources then the bin directory need to be added to the classpath of the console configuration. If for some reason hbm.xml is not copied here (they should if they are in a source directory) then you could just add the src dir to the classpath too.

_________________
Max
Don't forget to rate


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