-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Method not found exception with lazy loading
PostPosted: Wed Aug 29, 2007 4:56 am 
Beginner
Beginner

Joined: Tue May 17, 2005 2:48 pm
Posts: 47
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2008 8:44 am 
Newbie

Joined: Tue Oct 14, 2008 8:42 am
Posts: 1
Did you get the answer to your question.
I'm having the same problem


Top
 Profile  
 
 Post subject: Re: Method not found exception with lazy loading
PostPosted: Wed Mar 31, 2010 7:38 am 
Newbie

Joined: Wed Jan 13, 2010 10:43 am
Posts: 1
Anybody got the answer for this question? I am getting the same problem. I am going to be crazy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.