1
Vote

Unable to register MBean having overloaded methods.

description

I am trying to register an MBean having overloaded method signatures.
 
For eg:
 
public interface FooMBean
{
void method1(int p);
void method1(int p, int q);
}
 
When I do this, I get the following exception:
 
 
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boo
lean add)
at NetMX.Default.InternalInfo.MBeanInternalInfo..ctor(Type intfType)
at NetMX.Default.InternalInfo.MBeanInternalInfo.GetCached(Type intfType)
at NetMX.Default.StandardMBean..ctor(Object impl, Type intfType)
at NetMX.Default.MBeanServer.RegisterMBeanExternal(Object bean, ObjectName na
me)
at NetMX.Default.MBeanServer.RegisterMBean(Object bean, ObjectName name)
at JmxService.Program.register(IMBeanServer server, ObjectName objectName, Ob
ject o) in C:\p4\modules\trunk\JmxService\main-JmxService\JmxService\JmxService\
Program.cs:line 26
at JmxService.Program.Run(String[] args) in C:\p4\modules\trunk\JmxService\ma
in-JmxService\JmxService\JmxService\Program.cs:line 56
at JmxService.Program.Main(String[] args) in C:\p4\modules\trunk\JmxService\m
ain-JmxService\JmxService\JmxService\Program.cs:line 15
Press any key to continue . . .
 
I verified that if I rename the overloaded method to something else, it works.
 
I do not have control over the method naming, as I have to interop with a lot of java clients. Is there an easy way to fix this?
 
Thanks.

comments