It sounds like one of your classes is referencing another entity that you
haven't mapped.

On Sun, Jul 12, 2009 at 7:07 AM, Paul Batum <[email protected]> wrote:

> Yeah unfortunately NHibernate has a habit of throwing exceptions like that
> when there is something wrong with your configuration or your mapping. In
> this particular case I think its probably the mapping. Try mapping less of
> your entities - you need to narrow it down. If you have the NH debug symbols
> you can also jump into the callstack and find out the value of the
> 'className' argument passed to GetPersistantClass - that should give you a
> clue regarding which entity is causing the problem.
>
> Paul Batum
>
>
>
> On Sun, Jul 12, 2009 at 4:44 AM, Mikael Henriksson 
> <[email protected]>wrote:
>
>> I have no idea where this is coming from. I can successfully create the
>> whole database with:
>>
>>             _sessionFactory = Fluently.Configure()
>>
>> .Database(SQLiteConfiguration.Standard.UsingFile(PathToSqlLiteDb))
>>                     .Mappings(m => m.FluentMappings
>>                         .Add<ClubMap>()
>>                         .Add<ContactMap>()
>>                         .Add<ContactTypeMap>()
>>                         .Add<NewsMap>()
>>                         .Add<ResultMap>()
>>                         .Add<ResultTypeMap>()
>>                         .Add<ScheduleMap>()
>>                         .Add<TournamentMap>()
>>                         .Add<TournamentTypeMap>()
>>                         .ExportTo("D:\\"))
>>                         .ExposeConfiguration(BuildSchema)
>>                         .BuildConfiguration()
>>                         .BuildSessionFactory();
>>
>>             _session = _sessionFactory.OpenSession();
>>
>> Then after I have built the schema i goes to BuildSessionFactory and then
>> I get an exception:
>>
>>
>> System.Collections.Generic.KeyNotFoundException: The given key was not 
>> present in the dictionary.
>> at System.ThrowHelper.ThrowKeyNotFoundException()
>> at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
>> at NHibernate.Cfg.Configuration.Mapping.GetPersistentClass(String
>> className)
>> at NHibernate.Cfg.Configuration.Mapping.GetIdentifierType(String
>> className)
>> at NHibernate.Type.EntityType.GetIdentifierType(IMapping factory)
>> at NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType(IMapping
>> factory)
>> at NHibernate.Persister.Entity.AbstractPropertyMapping
>> .InitIdentifierPropertyPaths(String path, EntityType etype, String[]
>> columns, IMapping factory)
>> at NHibernate.Persister.Entity.AbstractPropertyMapping.InitPropertyPaths(
>> String path, IType type, String[] columns, String[] formulaTemplates,
>> IMapping factory)
>> at NHibernate.Persister.Entity.AbstractEntityPersister
>> .InitOrdinaryPropertyPaths(IMapping mapping)
>> at NHibernate.Persister.Entity.AbstractEntityPersister.InitPropertyPaths(
>> IMapping mapping)
>> at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(
>> PersistentClass persistentClass, ICacheConcurrencyStrategy cache,
>> ISessionFactoryImplementor factory, IMapping mapping)
>> at NHibernate.Persister.PersisterFactory.CreateClassPersister(
>> PersistentClass model, ICacheConcurrencyStrategy cache,
>> ISessionFactoryImplementor factory, IMapping cfg)
>> at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping
>> mapping, Settings settings, EventListeners listeners)
>> at NHibernate.Cfg.Configuration.BuildSessionFactory()
>>
>> That is by far the most retarded debug message I have ever seen :)
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to