[ 
https://issues.apache.org/jira/browse/CAMEL-7586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lefillastre Alexandre updated CAMEL-7586:
-----------------------------------------

    Description: 
Hello, I wasn't able to subscribe on the mailing list, so I'm posting my issue 
directly here.

In my project I need to use some ManagedCamelContextMBean, which I am trying to 
access through : 
[JMX.newMBeanProxy|http://docs.oracle.com/javase/8/docs/api/javax/management/JMX.html#newMBeanProxy-javax.management.MBeanServerConnection-javax.management.ObjectName-java.lang.Class-]

However, it is not working as I'm getting a NotCompliantMBeanException as the 
attribute MessageHistory seems to have more than one getter.

I checked the source code of newMBeanProxy, then the JMX 1.4 specification ( 
http://docs.oracle.com/javase/8/docs/technotes/guides/jmx/JMX_1_4_specification.pdf
 ), and then Camel's source code, and it appears that ManagedCamelContextMBean 
is indeed not respecting the standard MBean.

The problem is that two methods are defined in ManagedCamelContextMBean : 
isMessageHistory() and getMessageHistory()
Since the return type is boolean, isMessageHistory is considered to be a 
getter, which makes two getter according to the JMX specification and is 
blocking the newMBeanProxy() method.

  was:
Hello, I wasn't able to subscribe on the mailing list, so I'm posting my issue 
directly here.

In my project I need to use some ManagedCamelContextMBean, which I am trying to 
access through : javax.management.JMX.newMBeanProxy(MBeanServerConnection 
connection, ObjectName objectName, Class<?> interfaceClass)

However, it is not working as I'm getting a NotCompliantMBeanException as the 
attribute MessageHistory seems to have more than one getter.

I checked the source code of newMBeanProxy, then the JMX 1.4 specification ( 
http://docs.oracle.com/javase/8/docs/technotes/guides/jmx/JMX_1_4_specification.pdf
 ), and then Camel's source code, and it appears that ManagedCamelContextMBean 
is indeed not respecting the standard MBean.

The problem is that two methods are defined in ManagedCamelContextMBean : 
isMessageHistory() and getMessageHistory()
Since the return type is boolean, isMessageHistory is considered to be a 
getter, which makes two getter according to the JMX specification and is 
blocking the newMBeanProxy() method.


> NotCompliantMBeanException : Attribute MessageHistory has more than one getter
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-7586
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7586
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.12.3, 2.13.0
>            Reporter: Lefillastre Alexandre
>
> Hello, I wasn't able to subscribe on the mailing list, so I'm posting my 
> issue directly here.
> In my project I need to use some ManagedCamelContextMBean, which I am trying 
> to access through : 
> [JMX.newMBeanProxy|http://docs.oracle.com/javase/8/docs/api/javax/management/JMX.html#newMBeanProxy-javax.management.MBeanServerConnection-javax.management.ObjectName-java.lang.Class-]
> However, it is not working as I'm getting a NotCompliantMBeanException as the 
> attribute MessageHistory seems to have more than one getter.
> I checked the source code of newMBeanProxy, then the JMX 1.4 specification ( 
> http://docs.oracle.com/javase/8/docs/technotes/guides/jmx/JMX_1_4_specification.pdf
>  ), and then Camel's source code, and it appears that 
> ManagedCamelContextMBean is indeed not respecting the standard MBean.
> The problem is that two methods are defined in ManagedCamelContextMBean : 
> isMessageHistory() and getMessageHistory()
> Since the return type is boolean, isMessageHistory is considered to be a 
> getter, which makes two getter according to the JMX specification and is 
> blocking the newMBeanProxy() method.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to