Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.0.1.4000
Mapping documents:
Configured with FluentHibernate
Full stack trace of any exception that occurs:
mscorlib.dll!System.ThrowHelper.ThrowKeyNotFoundException() + 0x24 bytes
mscorlib.dll!System.Collections.Generic.Dictionary<System.__Canon,System.__Canon>.this[System.__Canon].get(System.__Canon key) + 0x4c bytes
> NHibernate.DLL!NHibernate.Cfg.Configuration.Mapping.GetPersistentClass(string className = "Zawerty.Model.Profile") Line 121 + 0x45 bytes C#
NHibernate.DLL!NHibernate.Cfg.Configuration.Mapping.GetIdentifierType(string className = "Zawerty.Model.Profile") Line 131 + 0xf bytes C#
NHibernate.DLL!NHibernate.Type.EntityType.GetIdentifierType(NHibernate.Engine.IMapping factory = {NHibernate.Cfg.Configuration.Mapping}) Line 366 + 0x46 bytes C#
NHibernate.DLL!NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType(NHibernate.Engine.IMapping factory = {NHibernate.Cfg.Configuration.Mapping}) Line 331 + 0x21 bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.AbstractPropertyMapping.InitIdentifierPropertyPaths(string path = "Profile", NHibernate.Type.EntityType etype = {NHibernate.Type.OneToOneType(Zawerty.Model.Profile)}, string[] columns = {string[1]}, NHibernate.Engine.IMapping factory = {NHibernate.Cfg.Configuration.Mapping}) Line 159 + 0x20 bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.AbstractPropertyMapping.InitPropertyPaths(string path = "Profile", NHibernate.Type.IType type = {NHibernate.Type.OneToOneType(Zawerty.Model.Profile)}, string[] columns = {string[1]}, string[] formulaTemplates = {string[0]}, NHibernate.Engine.IMapping factory = {NHibernate.Cfg.Configuration.Mapping}) Line 153 + 0x64 bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.AbstractEntityPersister.InitOrdinaryPropertyPaths(NHibernate.Engine.IMapping mapping = {NHibernate.Cfg.Configuration.Mapping}) Line 2054 + 0x1a4 bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.AbstractEntityPersister.InitPropertyPaths(NHibernate.Engine.IMapping mapping = {NHibernate.Cfg.Configuration.Mapping}) Line 2088 + 0xf bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.AbstractEntityPersister.PostConstruct(NHibernate.Engine.IMapping mapping = {NHibernate.Cfg.Configuration.Mapping}) Line 3236 + 0xf bytes C#
NHibernate.DLL!NHibernate.Persister.Entity.SingleTableEntityPersister.SingleTableEntityPersister(NHibernate.Mapping.PersistentClass persistentClass = {NHibernate.Mapping.RootClass(Zawerty.Model.User)}, NHibernate.Cache.ICacheConcurrencyStrategy cache = null, NHibernate.Engine.ISessionFactoryImplementor factory = {NHibernate.Impl.SessionFactoryImpl}, NHibernate.Engine.IMapping mapping = {NHibernate.Cfg.Configuration.Mapping}) Line 366 + 0x13 bytes C#
NHibernate.DLL!NHibernate.Persister.PersisterFactory.CreateClassPersister(NHibernate.Mapping.PersistentClass model = {NHibernate.Mapping.RootClass(Zawerty.Model.User)}, NHibernate.Cache.ICacheConcurrencyStrategy cache = null, NHibernate.Engine.ISessionFactoryImplementor factory = {NHibernate.Impl.SessionFactoryImpl}, NHibernate.Engine.IMapping cfg = {NHibernate.Cfg.Configuration.Mapping}) Line 51 + 0x43 bytes C#
NHibernate.DLL!NHibernate.Impl.SessionFactoryImpl.SessionFactoryImpl(NHibernate.Cfg.Configuration cfg = {NHibernate.Cfg.Configuration}, NHibernate.Engine.IMapping mapping = {NHibernate.Cfg.Configuration.Mapping}, NHibernate.Cfg.Settings settings = {NHibernate.Cfg.Settings}, NHibernate.Event.EventListeners listeners = {NHibernate.Event.EventListeners}) Line 229 + 0x1b bytes C#
NHibernate.DLL!NHibernate.Cfg.Configuration.BuildSessionFactory() Line 996 + 0x92 bytes C#
problem in nHibernate.Cfg.Configuration.cs:line 119
Code:
private PersistentClass GetPersistentClass(string className)
{
[b]PersistentClass pc = configuration.classes[className];[/b]
if (pc == null)
{
throw new MappingException("persistent class not known: " + className);
}
return pc;
}
highlighted code throw
KeyNotFoundException instead return null for follow check