-
Bug
-
Resolution: Fixed
-
P3
-
1.0
-
None
-
1.0
-
sparc
-
solaris_2.5.1
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2113248 | 5.0 | Eamonn McManus | P3 | Resolved | Fixed | tiger |
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");
}
"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");
}
- backported by
-
JDK-2113248 IllegalArgumentException not thrown for invalid protocol provider classloader
- Resolved