[Mono-dev] Ambiguous matching in method resolution

pablosantosluac at terra.es pablosantosluac at terra.es
Wed May 31 16:55:40 EDT 2006


Hi,

Well, I have a little more information know. I located the problem (I was 
not correctly handling the stack trace nor the --trace option), and it sems 
to have problems with certain methods defined in an interface used through 
remoting.

What I don't understand is that the client works correctly on linux against 
a windows server (mono - .NET), but fails in the linux - linux scenario... 
Lots of remote method calls failing with the ambiguous matching exception...



----- Original Message ----- 
From: "Rafael Teixeira" <monoman at gmail.com>
To: <pablosantosluac at terra.es>
Cc: <mono-devel-list at lists.ximian.com>
Sent: Wednesday, May 31, 2006 8:49 PM
Subject: Re: [Mono-dev] Ambiguous matching in method resolution


> Pablo and mscorlib hackers,
>
> Strange as that message is only found in the AmbiguousMatchException
> default constructor, that is called inside Reflection, and inside
> MonoType (an internal class) inside corlib.
>
> So that exception would be normally thrown out, and generate a stack
> trace. Unless the MonoType GetConstructorImpl method (probable
> culprit) is being called from unmanaged code, that doesn't properly
> handle exceptions (or can't in that particular situation).
>
> It looks like there's a logic error in that method. If you are asking
> for a parameterless constructor (by passing a null for the 'types'
> array parameter), if it counts more than one constructor, REGARDLESS
> OF THE NUMBER OF PARAMETERS EACH CONSTRUCTOR EXPECT, that matches the
> bindingflags, it will throw that exception.
>
> I think that it should first make sure it counts only methods that
> expect the same number and type of parameters, before entering that
> if.
>
> Some mscorlib hacker please take a look at that.
>
> Pablo,
>
> Probably you have more than one constructor with the same visibility
> as the parameterless constructor in some of your classes, to cause
> that exception, but as I think that is a common pattern, probably it
> is combined with some other factors I can't guess without a
> stacktrace, :(
>
> Hope it helps,
>
> On 5/31/06, pablosantosluac at terra.es <pablosantosluac at terra.es> wrote:
>> Hi,
>>
>> I have an application that is correctly running with .NET, but as soon as 
>> I
>> run it with mono (1.1.15) on Linux I get the following message:
>>
>> Error: Ambiguous matching in method resolution.
>>
>> I tried to recompile with mono on Linux with debug info, but I can't get 
>> any
>> more information, neither with --trace.
>>
>> What can I do to locate the problem?
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>
>
> -- 
> Rafael "Monoman" Teixeira
> ---------------------------------------
> As I'm currently working a lot with Java and even fixing Java VMs
> (JamVM/Kaffe) and GNU Classpath code, I think I may partly borrow the
> title (Javaman) from my friend Bruno Souza and become the
> MonoNJavaMan. Yeah, I may currently be crazier than usual... 




More information about the Mono-devel-list mailing list