]
Brian Stansberry updated WFCORE-1039:
-------------------------------------
Fix Version/s: 2.0.0.CR7
Intermittent failure in notification listener testing in
org.jboss.as.jmx.rbac.JmxRbacEnabledTestCase
-----------------------------------------------------------------------------------------------------
Key: WFCORE-1039
URL:
https://issues.jboss.org/browse/WFCORE-1039
Project: WildFly Core
Issue Type: Bug
Components: JMX, Test Suite
Affects Versions: 2.0.0.CR6
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Fix For: 2.0.0.CR7
For a while we've seen rare failures of that look like this:
{code}
java.lang.RuntimeException: java.security.PrivilegedActionException:
javax.management.ListenerNotFoundException: Unknown listener
at org.jboss.as.jmx.rbac.JmxRbacTestCase.checkMBeanAccess(JmxRbacTestCase.java:484)
at
org.jboss.as.jmx.rbac.JmxRbacTestCase.testMonitorNonSensitiveMBeans(JmxRbacTestCase.java:219)
...
Caused by: java.security.PrivilegedActionException: null
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.jboss.as.jmx.rbac.JmxRbacTestCase.checkMBeanAccess(JmxRbacTestCase.java:254)
at
org.jboss.as.jmx.rbac.JmxRbacTestCase.testMonitorNonSensitiveMBeans(JmxRbacTestCase.java:219)
...
Caused by: javax.management.ListenerNotFoundException: Unknown listener
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.removeNotificationListener(DefaultMBeanServerInterceptor.java:1339)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.removeNotificationListener(DefaultMBeanServerInterceptor.java:1242)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.removeNotificationListener(JmxMBeanServer.java:870)
at
org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.removeNotificationListener(PluggableMBeanServerImpl.java:1544)
at
org.jboss.as.jmx.PluggableMBeanServerImpl.removeNotificationListener(PluggableMBeanServerImpl.java:969)
at org.jboss.as.jmx.rbac.JmxRbacTestCase$1.run(JmxRbacTestCase.java:368)
at org.jboss.as.jmx.rbac.JmxRbacTestCase$1.run(JmxRbacTestCase.java:254)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.jboss.as.jmx.rbac.JmxRbacTestCase.checkMBeanAccess(JmxRbacTestCase.java:254)
at
org.jboss.as.jmx.rbac.JmxRbacTestCase.testMonitorNonSensitiveMBeans(JmxRbacTestCase.java:219)
{code}
The problem is the TestModelMBean used by the test is not holding a ref to the
"listenerWrapper" that the JVM MBeanServer passes into its
addNotificationListener method. That allows that listenerWrapper to be gc'd, resulting
in the failure of the removeNotificationListener call on the next line of the test.
The test holding a ref to the listener doesn't matter, as it's a
"listenerWrapper" object that matters.