To answer my own question, it was just me beeing a retard. When adding a
breakpoint when AmbiguousMatchException was thrown gave me a hint on
which class that had the ambiguity, I had two properties with the same
name and different casing (doh!), one private and one public. I reverted
to a private field and used Access = PropertyAccess.FieldCamelcase instead.

Hopefully this helps someone else.

Jimmy Shimizu wrote:
> Hello, we just tried upgrading to a late trunk version, with NHibernate
> 2.1 alpha3 and after resolving some changes I have come across this issue:
>
> [AmbiguousMatchException: Ambiguous match found.]
>    System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, 
> Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) 
> +7525732
>    System.Type.GetProperty(String name, BindingFlags bindingAttr) +31
>    NHibernate.Properties.BasicPropertyAccessor.GetSetterOrNull(Type type, 
> String propertyName) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Properties\BasicPropertyAccessor.cs:136
>    NHibernate.Properties.BasicPropertyAccessor.GetSetter(Type type, String 
> propertyName) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Properties\BasicPropertyAccessor.cs:55
>    NHibernate.Mapping.Property.GetSetter(Type clazz) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Mapping\Property.cs:182
>    NHibernate.Tuple.Entity.PocoEntityTuplizer.BuildPropertySetter(Property 
> mappedProperty, PersistentClass mappedEntity) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Tuple\Entity\PocoEntityTuplizer.cs:92
>    NHibernate.Tuple.Entity.AbstractEntityTuplizer..ctor(EntityMetamodel 
> entityMetamodel, PersistentClass mappingInfo) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Tuple\Entity\AbstractEntityTuplizer.cs:57
>    NHibernate.Tuple.Entity.PocoEntityTuplizer..ctor(EntityMetamodel 
> entityMetamodel, PersistentClass mappedEntity) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Tuple\Entity\PocoEntityTuplizer.cs:45
>    
> NHibernate.Tuple.Entity.EntityEntityModeToTuplizerMapping..ctor(PersistentClass
>  mappedEntity, EntityMetamodel em) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Tuple\Entity\EntityEntityModeToTuplizerMapping.cs:58
>    NHibernate.Tuple.Entity.EntityMetamodel..ctor(PersistentClass 
> persistentClass, ISessionFactoryImplementor sessionFactory) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Tuple\Entity\EntityMetamodel.cs:276
>    NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass 
> persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor 
> factory) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:271
>    
> NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass 
> persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor 
> factory, IMapping mapping) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Persister\Entity\SingleTableEntityPersister.cs:71
>    NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass 
> model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, 
> IMapping cfg) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Persister\PersisterFactory.cs:51
>    NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping 
> mapping, Settings settings, EventListeners listeners) in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:207
>    NHibernate.Cfg.Configuration.BuildSessionFactory() in 
> c:\CSharp\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:1090
>    Castle.ActiveRecord.Framework.SessionFactoryHolder.GetSessionFactory(Type 
> type) +499
>    Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateSession(Type 
> type) +149
>    Castle.ActiveRecord.ActiveRecordBase.FindAll(Type targetType, Order[] 
> orders, ICriterion[] criteria) +116
>    Castle.ActiveRecord.ActiveRecordMediator.FindAll(Type targetType, Order[] 
> orders, ICriterion[] criterias) +69
>    Castle.ActiveRecord.ActiveRecordMediator.FindAll(Type targetType) +92
>    Castle.ActiveRecord.ActiveRecordMediator`1.FindAll() +104
>
>
>
> They seem to have implemented BindingFlags.IgnoreCase in GetSetterOrNull
> but I can't find which class it is trying to reflect on. All I know is
> that it's this row that triggers it all,
> var configValues = ActiveRecordMediator<ConfigValue>.FindAll();
> But after that call and the actual exception, no queries is sent to the
> database. It never actually reaches the point where it tries to reflect
> my class ConfigValue.
>
> Has anyone come across this issue?
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to