Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6358393

Exception thrown when an invalid JMXServiceURL is passed to JMXConnectorFactory.connect()

    XMLWordPrintable

    Details

      Description

      1. If I enter the following string in the Remote Process input line:

      service:jmx:rmi:///jndi/rmi://foo:bar

      No error message is reported. The Connection dialog just disappears.

      At the same time, the following is printed to the terminal:

      Exception in thread "JConsole.addUrl" java.lang.NumberFormatException: For input string: "bar"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
              at java.lang.Integer.parseInt(Integer.java:447)
              at java.lang.Integer.parseInt(Integer.java:497)
              at com.sun.jndi.url.rmi.rmiURLContext.getRootURLContext(rmiURLContext.java:86)
              at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
              at javax.naming.InitialContext.lookup(InitialContext.java:351)
              at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1871)
              at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1841)
              at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:255)
              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
              at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:116)
              at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:87)
              at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:173)
              at sun.tools.jconsole.JConsole$2.run(JConsole.java:404)

      2. The same if I enter '99999' as a port number, but a different exception:

      Exception in thread "JConsole.addUrl" java.lang.ClassCastException: com.sun.jndi.rmi.registry.RegistryContext cannot be cast to javax.management.remote.rmi.RMIServer
              at javax.management.remote.rmi.RMIConnector.narrowJRMPServer(RMIConnector.java:1882)
              at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1877)
              at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1841)
              at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:255)
              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
              at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:116)
              at sun.tools.jconsole.ProxyClient.<init>(ProxyClient.java:87)
              at sun.tools.jconsole.ProxyClient.getProxyClient(ProxyClient.java:173)
              at sun.tools.jconsole.JConsole$2.run(JConsole.java:404)

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kshiroko Kirill Shirokov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: