The ExecutorTest.java fails in cca. 30-40% of runs with NPE in the part testing IIOP connection.
The failure is caused by the JMX notification processing - ideally, once the RMIConnector is closed the client JMX notification processing should quit as well and should not try to fetch any more notifications over the already closed remote connection. But achieving this is particularly difficult mostly due to the synchronous nature of the fetchNotifications() method. The RMIConnector can get closed after the fetchNotifications() method was entered but before attempting to invoke its remote counterpart. At this moment the remote connection is effectively closed and any attempt to use it will throw an exception - a NPE in this case. The patch does not solve the core problem as it would probably require significant changes in the client JMX notification processing - rather it targets the NPE which becomes expected when the RMIConnector is closed. This is handled by adding a new "catch (NullPointerException)" block and, inside that block, checking for the connection state and rethrowing the exception in case the connection is still open (RMIConnector is started). For any other state of RMIConnector the NPE is ignored. The webrev is located at: http://washi.ru.oracle.com/jb198685/webrev/7195779 -JB-