-->
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: Problem mapping resource in xml config file
PostPosted: Tue Oct 04, 2005 6:28 am 
Newbie

Joined: Tue Oct 04, 2005 6:20 am
Posts: 9
I have an two files, both are embedded, in Visual Studio .Net.

They are hibernate.hbm.xml and Part.hbm.xml

In the file hibernate.hbm.xml I can use <mapping assembly="myassembly"/> and the configuration works fine.

However, if I change it to <mapping resource="Part.hbm.xml"/> it fails with the following message:

Object reference not set to an instance of an object.

Any ideas why this may be, I'm fairly sure it is to do with the <mapping> tag because changing this causes the error.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 7:53 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
IIRC, when using "resource", you must also set the "assembly" so that NHibernate knows where to extract the resource.

Anyway, it should throw a meaningful exception...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 9:07 am 
Newbie

Joined: Tue Oct 04, 2005 6:20 am
Posts: 9
I added the assembly

<mapping resource="Part.hbm.xml" assembly="myassembly"/>

Now I get the following error:


Additional information: Resource: Part.hbm.xml not found


But the file Part.hbm.xml is an embedded resource.

Any ideas now?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 11:14 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Open your assembly with ILDAsm to see the "Full Qualified Name" of your resource; most of the time, it is:
Code:
<mapping resource="MyAssembly.Part.hbm.xml"  assembly="MyAssembly"/>

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 8:09 am 
Newbie

Joined: Tue Oct 04, 2005 6:20 am
Posts: 9
Worked a treat, thank you very much :D :D


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.