IllegalArgumentException not thrown for invalid protocol provider classloader

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 1.0
    • Affects Version/s: 1.0
    • Component/s: core-svc
    • None
    • 1.0
    • sparc
    • solaris_2.5.1

        The javadoc for JMXConnectorFactory and JMXConnectorServerFactory says:

        "If the environment parameter to newJMXConnector(Server) contains the key
        jmx.remote.protocol.provider.class.loader then the associated value is the
        class loader to use to load the provider. If the associated value is not an
        instance of ClassLoader, an IllegalArgumentException is thrown."

        But IllegalArgumentException is never thrown when the value of the
        property is not an instance of ClassLoader.

        Server side:

            // Create environment map
            //
            final HashMap env = new HashMap(1);
            env.put(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER, "dummy");

            // Create a JMXConnectorServer
            //
            try {
                JMXConnectorServerFactory.newJMXConnectorServer(url, env, mbs);
                errorCount++;
            } catch (IllegalArgumentException e) {
                status = Status.passed("Got expected IllegalArgumentException");
            }

        Client side:

            // Create environment map
            //
            final HashMap env = new HashMap(1);
            env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, "dummy");

            // Create a JMXConnector
            //
            try {
                JMXConnectorFactory.newJMXConnector(server.getAddress(), env);
                errorCount++;
            } catch (IllegalArgumentException e) {
                status = Status.passed("Got expected IllegalArgumentException");
            }

              Assignee:
              Eamonn McManus
              Reporter:
              Luis-Miguel Alventosa (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: