[infinispan-issues] [JBoss JIRA] (ISPN-2756) Enabling/disabling RpcManager statistics via JMX doesn't work
Dan Berindei (JIRA)
jira-events at lists.jboss.org
Fri Jan 25 06:47:47 EST 2013
[ https://issues.jboss.org/browse/ISPN-2756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750504#comment-12750504 ]
Dan Berindei commented on ISPN-2756:
------------------------------------
Looks like the {{statisticsEnabled}} field and the {{isStatisticsEnabled}} method both have a {{@ManagedAttribute}} annotation and a {{JmxAttributeMetadata}} entry in the component metadata, but {{isStatisticsEnabled}} doesn't have write enabled.
{{ResourceDMBean}} processes the {{JmxAttributeMetadata}} entries in no particular order, so it could process the field entry last (meaning the attribute will be writable), or it could process the method entry last (and the attribute will be read-only). I think we should not allow components to use the {{@ManagedAttribute}} more than once for the same attribute.
I think we should also stop swallowing exceptions in {{ResourceDMBean}}.
> Enabling/disabling RpcManager statistics via JMX doesn't work
> -------------------------------------------------------------
>
> Key: ISPN-2756
> URL: https://issues.jboss.org/browse/ISPN-2756
> Project: Infinispan
> Issue Type: Bug
> Components: JMX, reporting and management
> Affects Versions: 5.2.0.CR2
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Fix For: 5.2.0.Final
>
>
> The test RpcManagerMBeanTest.testEnableJmxStats tries to write to the "StatisticsEnabled" attribute but fails. The operation doesn't throw an exception, but it does log this WARN message:
> {noformat}
> 10:43:42,079 WARN (testng-RpcManagerMBeanTest:) [ResourceDMBean] ISPN000043: Exception while writing value for attribute statisticsEnabled
> java.lang.NullPointerException
> at org.infinispan.jmx.ResourceDMBean$InvokableSetterBasedMBeanAttributeInfo.invoke(ResourceDMBean.java:391)
> at org.infinispan.jmx.ResourceDMBean.setNamedAttribute(ResourceDMBean.java:325)
> at org.infinispan.jmx.ResourceDMBean.setAttribute(ResourceDMBean.java:212)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.setAttribute(DefaultMBeanServerInterceptor.java:746)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.setAttribute(JmxMBeanServer.java:729)
> at org.infinispan.jmx.RpcManagerMBeanTest.testEnableJmxStats(RpcManagerMBeanTest.java:134)
> {noformat}
> Because statistics are still enabled, the test then fails with an assertion error:
> {noformat}
> 10:43:42,464 ERROR (testng-RpcManagerMBeanTest:) [UnitTestTestNGListener] Test testEnableJmxStats(org.infinispan.jmx.RpcManagerMBeanTest) failed.
> java.lang.AssertionError: expected [-1] but found [1]
> at org.testng.Assert.fail(Assert.java:94)
> at org.testng.Assert.failNotEquals(Assert.java:494)
> at org.testng.Assert.assertEquals(Assert.java:123)
> at org.testng.Assert.assertEquals(Assert.java:165)
> at org.infinispan.jmx.RpcManagerMBeanTest.testEnableJmxStats(RpcManagerMBeanTest.java:138)
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list