Hi,
I get the following exception when loading a list of objects:
Method not found: 'System.Object Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(System.Type, System.Type[], Castle.DynamicProxy.IInterceptor, Boolean, System.Object[])'.
I set lazy to true in all my mapping files. When I set lazy to false, this doesn't happen. But I don't want that, because it takes forever to load the objects. All the classes have public virtual methods and they are all not sealed.
Does anyone know what goes wrong here?
Hibernate version:
1.2.0
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Line 65: throw new HibernateException("Creating a proxy instance failed", e);
Line 66: }
Line 67: }
Line 68: }
Line 69: }
[MissingMethodException: Method not found: 'System.Object Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(System.Type, System.Type[], Castle.DynamicProxy.IInterceptor, Boolean, System.Object[])'.]
NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session) in C:\Dev\NHibernate\NHibernate\src\NHibernate\Proxy\CastleProxyFactory.cs:67
NHibernate.Persister.Entity.AbstractEntityPersister.CreateProxy(Object id, ISessionImplementor session) in C:\Dev\NHibernate\NHibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:1610
NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation) in C:\Dev\NHibernate\NHibernate\src\NHibernate\Impl\SessionImpl.cs:2573
NHibernate.Impl.SessionImpl.Load(Type clazz, Object id) in C:\Dev\NHibernate\NHibernate\src\NHibernate\Impl\SessionImpl.cs:2406
NHibernate.DAL.NHibernateDao`2.GetById(IdT id, Boolean shouldLock) in C:\Dev\SampleApp\Data access\NHibernate\NHibernate.DAL\NHibernateDao.cs:34
SampleApp.Presenters.Presenter`2.GetDomainObject(IdT id) in C:\Dev\SampleApp\SampleApp.Presenters\Presenter.cs:52
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +358
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.FormView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.FormView.EnsureDataBound() +163
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Name and version of the database you are using:
SQL Server 2005
|