-->
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.  [ 5 posts ] 
Author Message
 Post subject: De-Serializing a Proxy
PostPosted: Fri Jun 24, 2005 4:37 am 
Newbie

Joined: Thu Jun 02, 2005 10:58 pm
Posts: 5
Hi All,

I have a .NET Remote Object deployed on IIS that is passing back detached objects to a Winform Client. I'm using the default Binary Formatter.

When there are no lazily loaded proxies associated with the detached business objects, it works fine.

However when I do lazy load some of the associations and it tries to pass back a proxy, I get the error at the bottom of this post.

I did notice another post at http://nhibernate.sourceforge.net/forum ... .php?t=298 regarding problems with deserializing proxies and I was wondering if the error below was related?

Thanks for your help.
Gaj

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.AmbiguousMatchException: Ambiguous match found.
at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetMethod(String name)
at Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.MethodTokenExpression.Emit(IEasyMember member, ILGenerator gen)
at Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.VirtualMethodInvocationExpression.Emit(IEasyMember member, ILGenerator gen)
at Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.AssignStatement.Emit(IEasyMember member, ILGenerator gen)
at Castle.DynamicProxy.Builder.CodeBuilder.AbstractCodeBuilder.Generate(IEasyMember member, ILGenerator il)
at Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod.Generate()
at Castle.DynamicProxy.Builder.CodeBuilder.EasyProperty.Generate()


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 24, 2005 9:57 am 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
This is not related to the other issue.

The exception indicates that the type of the proxy has more than one property with the same name. This happens when you (or in this case, NHibernate) retrieves the properties of a proxy with reflection and with the default bindingflags. This returns the properties of the original class but also the properties of the generated proxy (that have the same name).

Might be a bug in NHibernate but I don't know for sure.

_________________
Cuyahoga


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 24, 2005 2:46 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Gaj, are you using .NET 2.0? I remember some problem like this occuring in DynamicProxy on .NET 2.0, it's not really supported yet.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 2:11 am 
Newbie

Joined: Thu Jun 02, 2005 10:58 pm
Posts: 5
Hi Sergey,

I'm still using .NET v1.1.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 29, 2005 10:27 pm 
Newbie

Joined: Wed Jun 22, 2005 9:20 am
Posts: 4
Can you send us a test case that reproduces the error?

http://support.castleproject.org/jira/s ... board.jspa

for the records, .Net 2 is fixed, but NHibernate will include the fixed version on the 0.9 release..

_________________
Cheers,
hammett
http://www.castleproject.org/~hammett


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.