Bug 738031
Summary: | as5 plugin: IllegalAccessException occurs in EMS during attempt to initialize EMS connection to an AS 6.0 instance | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Ian Springer <ian.springer> |
Component: | Plugins | Assignee: | Heiko W. Rupp <hrupp> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 4.1 | CC: | ccrouch, hrupp, jshaughn |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-30 12:27:08 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 678340 |
Description
Ian Springer
2011-09-13 16:38:57 UTC
This is fixed by [master 8bb8c6d], which upgrades EMS from 1.2.15.1 to 1.2.16. The fix that was added in EMS 1.2.16 was to ensure the java.lang.Method object used in the MBeanServer proxy (org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy) is accessible, prior to invoking it. Here's the code that attempts to obtain an accessible version of the Method: private static Method getAccessibleMethod(Method method) { try { method.setAccessible(true); return method; } catch (SecurityException e) { // If the class declaring the method is itself not public, the method will not be accessible, so attempt to // find a method with the same signature on one of the server class's interfaces. if (!Modifier.isPublic(method.getDeclaringClass().getModifiers())) { Method interfaceMethod = getInterfaceMethod(method); if (interfaceMethod != null) { return interfaceMethod; } } return method; } } private static Method getInterfaceMethod(Method method) { Class<?>[] interfaceClasses = method.getClass().getInterfaces(); for (int i = 0, interfaceClassesLength = interfaceClasses.length; i < interfaceClassesLength; i++) { Class interfaceClass = interfaceClasses[i]; try { return interfaceClass.getMethod(method.getName(), method.getParameterTypes()); } catch (NoSuchMethodException e) { // ignore } catch (SecurityException e) { // ignore } } // Return null to indicate we were unable to find an interface method. return null; } That change is pretty old and has been on the release branch for ever (as far as I can see). This version of EMS got overwritten on Nov 4th by the change of Bug 701375 Can monitor AS6 nicely, no more exception in the log. BUT after rebooting as6, I can no longer monitor the JVM part of it ResourceError is showing org.mc4j.ems.connection.EmsConnectException: java.io.IOException: The client has been closed. at org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy.invoke(GenericMBeanServerProxy.java:135) at $Proxy68.isRegistered(Unknown Source) at org.mc4j.ems.impl.jmx.connection.bean.DMBean.isRegistered(DMBean.java:188) at org.rhq.plugins.jmx.MBeanResourceComponent.isMBeanAvailable(MBeanResourceComponent.java:240) at org.rhq.plugins.jmx.MBeanResourceComponent.getAvailability(MBeanResourceComponent.java:227) at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.io.IOException: The client has been closed. at com.sun.jmx.remote.internal.ClientCommunicatorAdmin.restart(ClientCommunicatorAdmin.java:74) at com.sun.jmx.remote.internal.ClientCommunicatorAdmin.gotIOException(ClientCommunicatorAdmin.java:34) at javax.management.remote.rmi.RMIConnector$RMIClientCommunicatorAdmin.gotIOException(RMIConnector.java:1437) at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.isRegistered(RMIConnector.java:841) at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy.invokeInternal(GenericMBeanServerProxy.java:168) at org.mc4j.ems.impl.jmx.connection.support.providers.proxy.GenericMBeanServerProxy.invoke(GenericMBeanServerProxy.java:103) ... 13 more Heiko, please triage this legacy Ian issue. Thanks. I think this got fixed with all the changes in JXM handling and re-establishing of connections. |