Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Maverick 6/1/2005 10:05 AM (edited 6/1/2005 10:09 AM)
I write a demo. It includes guestbook.data and guestbook.web.
I put users.cs and user.hbm.xml into the folder of guestbook.data.
The hbm.xml file is set to embedded resource and config informations are added into web.config.
It compiles successfully.

But, When i add an user in useredit.aspx of guestbook.web, it throws an exception:
NHibernate.MappingException: No persisters for: Guestbook.Data.Users at NHibernate.Impl.SessionFactoryImpl.GetPersister(Type theClass) at NHibernate.Impl.SessionImpl.GetPersister(Type theClass) at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier(Object obj, CascadingAction action, Object anything) at NHibernate.Impl.SessionImpl.Save(Object obj) at Guestbook.Web.UserEdit.btnAdd_Click(Object sender, EventArgs e) in e:\website\www\guestbook\guestbook.web\useredit.aspx.cs:line 95

In Cuyahoga, all hbm.xml are in folder of Cuyahoga.Core.Domain.
Why my demo does not work?

BTW: I find that martijn is famous in NHiberante forum:)
# martijnb 6/1/2005 12:18 PM
This looks like a typo. Your class and the mapping file should have the same name (for example User.cs and User.hbm.xml).
# Maverick 6/1/2005 7:12 PM
the Users.cs file and Users.hbm.xml file is generated by MyGeneration.
they have same name.
# martijnb 6/2/2005 1:46 AM
Ah ok.

Did you REbuild the Guestbook.Data project? This is essential when you're having mapping files as embedded resource.

BTW, you can better ask these kind of questions in the NHibernate forum. There are much more helpful people over there.