Found the problem. Column names for HasMany and HasManyToMany were not
getting set in my AutoMappingOverrides. I thought the default
conventions and my custom conventions would take care of all those
stuff allowing you to simply say map.HasManyToMany(o => o.Orders) for
instance, but apparently if you use an override you have to explicitly
set everything cause the conventions won't have a chance to do any
post-processing.
In any case, I hope some one learns from my dumb mistake. :)

On Apr 14, 3:53 pm, Jimit <[email protected]> wrote:
> Hi,
> I've been encountering the following error when trying to build a
> session factory.
>
> PersistenceTests.Can_Map_Orders_To_Database : Failed
> System.IndexOutOfRangeException: Index was outside the bounds of the
> array.
> at NHibernate.Mapping.Column.set_Name(String value)
> at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumns(XmlNode node,
> SimpleValue model, Boolean isNullable, Boolean autoColumn, String
> propertyPath)
> at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindColumnsOrFormula
> (XmlNode node, SimpleValue simpleValue, String path, Boolean
> isNullable)
> at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindSimpleValue(XmlNode
> node, SimpleValue model, Boolean isNullable, String path)
> at
> NHibernate.Cfg.XmlHbmBinding.CollectionBinder.BindCollectionSecondPass
> (XmlNode node, Collection model, IDictionary`2 persistentClasses)
> at
> NHibernate.Cfg.XmlHbmBinding.CollectionBinder.<>c__DisplayClassd.<AddCollec 
> tionSecondPass>b__c
> (IDictionary`2 persistentClasses)
> at NHibernate.Cfg.Configuration.SecondPassCompile()
> at NHibernate.Cfg.Configuration.BuildSessionFactory()
> at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
> \Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
> \Cfg\FluentConfiguration.cs: line 94
> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or
> incomplete configuration was used while creating a SessionFactory.
> Check PotentialReasons collection, and InnerException for more detail.
>
> at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
> \Code Samples\NHibernate\Fluent Nhibernate - Trunk\src\FluentNHibernate
> \Cfg\FluentConfiguration.cs: line 99
> at FluentNHibernate.SessionSource..ctor(FluentConfiguration config) in
> c:\Code Samples\NHibernate\Fluent Nhibernate - Trunk\src
> \FluentNHibernate\SessionSource.cs: line 38
> at
> FluentNHibernate.Testing.SingleConnectionSessionSourceForSQLiteInMemoryTest 
> ing..ctor
> (FluentConfiguration config) in c:\Code Samples\NHibernate\Fluent
> Nhibernate - Trunk\src\FluentNHibernate\Testing
> \SingleConnectionSessionSourceForSQLiteInMemoryTesting.cs: line 15
> at Core.Infrastructure.Data.NHibernate.Tests.PersistenceTests.SetUp()
> in PersistenceTests.cs: line 26
>
> I'm working against the FNH trunk and NH 2.0.1. Funny thing is I am
> able to compile my mappings (via AutoPersistenceModel.CompileMappings)
> and write them to the file system successfully - FNH doesn't complain.
> It is only when attempting to build the session factory that
> everything goes kaboom with the not very helpful error message above.
> Anyone got any ideas?
--~--~---------~--~----~------------~-------~--~----~
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