JDK-8177721 : Improve diagnostics in sun.management.Agent#startAgent()
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-03-28
  • Updated: 2018-05-14
  • Resolved: 2017-05-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8 JDK 9
10 b08Fixed 8u172Fixed 9Fixed
Description
In sun/management/jmxremote/ConnectorBootstrap.java, in exportMBeanServer(), we wrap IOException in AgentConfigurationError:

        catch(IOException ioexception)
        {
            if(jmxconnectorserver == null)
                throw new
AgentConfigurationError("agent.err.connector.server.io.error", ioexception,
new String[] {
                    jmxserviceurl.toString()
                });


But in the Agent.java this exception is caught and the wrapped exception is
ignored:

            if (jmxremote != null || jmxremotePort != null) {
259                if (jmxremotePort != null) {
260                   jmxServer = ConnectorBootstrap.
261                               startRemoteConnectorServer(jmxremotePort, props);
262                    startDiscoveryService(props);
263                }
264                startLocalManagementAgent();
265             }
266
267        } catch (AgentConfigurationError e) {
268            error(e.getError(), e.getParams());  <--this just prints the
error message and not the stack trace and ignores the wrapped exception
269        } catch (Exception e) {
270            error(e);
271        }

We should fix this code to print information about the original exception as
well.

With the current code, what the user sees is the following message without the i/o error that caused this failure:

Error: JMX connector server communication error:
service:jmx:rmi://us2z24-emcs-nvm-ita-loader1.emcs.z24.usdc2.oraclecloud.com