Hey Sergey,
I'm still seeing this problem - I have an abstract class DeliveryDomain which has an abstract method GetInterimReport and a concrete DeliveryProfile class which exposes a property of type DeliveryDomain which should return proxies of DeliveryDomain objects or concrete implementations.
When a proxy is created for the created the following exception is thrown which seems to indicate that there's a problem with abstract methods:
Code:
[3684] [NHibernate]
[3684] HibernateException
[3684] Creating a proxy instance failed
[3684] at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
[3684] at NHibernate.Persister.AbstractEntityPersister.CreateProxy(Object id, ISessionImplementor session)
[3684] at NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
[3684] at NHibernate.Impl.SessionImpl.InternalLoad(Type clazz, Object id)
[3684] at NHibernate.Type.ManyToOneType.ResolveIdentifier(Object id, ISessionImplementor session)
[3684] at NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session, Object owner)
[3684] at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
[3684] at NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList hydratedObjects, Object resultSetId, ISessionImplementor session)
[3684] at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
[3684] at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
[3684] at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
[3684] at NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
[3684] at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
[3684] [mscorlib]
[3684] TypeLoadException
[3684] Method 'GetInterimReport' in type 'CProxyTypeDeliveryDomainEntities_INHibernateProxy_ISerializable2' from assembly 'DynamicAssemblyProxyGen, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
[3684] at System.Reflection.Emit.TypeBuilder.TermCreateClass(Int32 handle, Module module)
[3684] at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
[3684] at System.Reflection.Emit.TypeBuilder.CreateType()
[3684] at Castle.DynamicProxy.Builder.CodeBuilder.AbstractEasyType.BuildType()
[3684] at Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateType()
[3684] at Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[] interfaces)
[3684] at Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces)
[3684] at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
[3684] at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
I'm using 1.0.2, so can you suggest anything I might be doing wrong?
Cheers,
Symon.