2010-06-02 34 views
0

我對於例外情況非常擔心。單軌救援,「字典中沒有給出鑰匙。」

我正在使用Active Record和Monorail。我能夠在單軌中使用腳手架控制器,直到我添加新的模型。

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. 
at System.Collections.Generic.Dictionary`2[System.String,NHibernate.Mapping.PersistentClass].get_Item (System.String key) [0x00000] 
at NHibernate.Cfg.Configuration+Mapping.GetPersistentClass (System.String className) [0x00000] 
at NHibernate.Cfg.Configuration+Mapping.GetIdentifierType (System.String className) [0x00000] 
at NHibernate.Type.EntityType.GetIdentifierType (IMapping factory) [0x00000] 
at NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType (IMapping factory) [0x00000] 
at NHibernate.Persister.Entity.AbstractPropertyMapping.InitIdentifierPropertyPaths (System.String path, NHibernate.Type.EntityType etype, System.String[] columns, IMapping factory) [0x00000] 
at NHibernate.Persister.Entity.AbstractPropertyMapping.InitPropertyPaths (System.String path, IType type, System.String[] columns, System.String[] formulaTemplates, IMapping factory) [0x00000] 
at NHibernate.Persister.Entity.AbstractEntityPersister.InitOrdinaryPropertyPaths (IMapping mapping) [0x00000] 
at NHibernate.Persister.Entity.AbstractEntityPersister.InitPropertyPaths (IMapping mapping) [0x00000] 
at NHibernate.Persister.Entity.AbstractEntityPersister.PostConstruct (IMapping mapping) [0x00000] 
at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor (NHibernate.Mapping.PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) [0x00000] 
at NHibernate.Persister.PersisterFactory.CreateClassPersister (NHibernate.Mapping.PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) [0x00000] 
at NHibernate.Impl.SessionFactoryImpl..ctor (NHibernate.Cfg.Configuration cfg, IMapping mapping, NHibernate.Cfg.Settings settings, NHibernate.Event.EventListeners listeners) [0x00000] 
at NHibernate.Cfg.Configuration.BuildSessionFactory() [0x00000] 
at Castle.ActiveRecord.Framework.SessionFactoryHolder.GetSessionFactory (System.Type type) [0x00000] 
at Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateScopeSession (System.Type type) [0x00000] 
at Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateSession (System.Type type) [0x00000] 
at (wrapper synchronized) Castle.ActiveRecord.Framework.SessionFactoryHolder:CreateSession (System.Type) 
at Castle.ActiveRecord.ActiveRecordBase.FindAll (System.Type targetType, NHibernate.Criterion.DetachedCriteria detachedCriteria, NHibernate.Criterion.Order[] orders) [0x00000] 
at Castle.ActiveRecord.ActiveRecordBase.FindAll (System.Type targetType) [0x00000] 
at Inventory.Product.FindAll() [0x00000] in /home/mariocesar/Proyectos/Mangos/Mangos.Apps/Inventory/Product.cs:114 
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) 
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] 

這裏是所有的源代碼:http://bitbucket.org/mariocesar/mangos/src

通過實例,對模型Inventory.Product有ProductsController類,它的工作,直到我添加一些關係。

http://bitbucket.org/mariocesar/mangos/src/tip/Mangos.Apps/Inventory/Product.cs

我不明白,如果問題是出在NHibernate的,或者如果不能腳手架,或者如果問題是ActivRecord。

提示,會不錯

回答