Details
Description
During connector config validation, ConfigDef.validateAll(...) is invoked using a Connector ConfigDef. This ConfigDef contains definitions for the key and value converters, which have the type ConfigDef.Type.CLASS. When plugin aliases are used for these configs, an error is encountered and the connector configuration is rejected.
This error occurs because Class.forName(...) is used to load the classes for these configs during validation. Even though the DelegatingClassLoader used by Connect successfully loads the requested class in its loadClass(...) method, some (if not all) implementations of the Java runtime will then perform a check in their native Class.forName method to verify that the name of the loaded class matches the requested class name. For example, see this section of OpenJDK that performs the aforementioned check.
A few possible fixes that come to mind include altering the connector validation in the AbstractHerder class to not use the ConfigDef.validateAll(...) method, or altering the logic used by the ConfigDef in its validateAll method for configs of type ConfigDef.Type.CLASS to use ClassLoader.loadClass(...) either instead of or in addition to Class.forName(...).
Attachments
Issue Links
- relates to
-
KAFKA-17150 Connect converter validation does not accept class aliases
- Resolved
- links to