[ 
https://issues.apache.org/jira/browse/KAFKA-9376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240706#comment-17240706
 ] 

shezm commented on KAFKA-9376:
------------------------------

Hi,I had the same problem too(release 2.4.0 with scala 2.12). 

I think the problem is here:

 
{code:java}
public class DelegatingClassLoader extends URLClassLoader {
...... other code
/**
 * Retrieve the PluginClassLoader associated with a plugin class
 * @param name The fully qualified class name of the plugin
 * @return the PluginClassLoader that should be used to load this, or null if 
the plugin is not isolated.
 */
public PluginClassLoader pluginClassLoader(String name) {
    if (!PluginUtils.shouldLoadInIsolation(name)) {
        return null;
    }
    SortedMap<PluginDesc<?>, ClassLoader> inner = pluginLoaders.get(name);
    if (inner == null) {
        return null;
    }
    //------------------- is here -------------------
    // I found `pluginLoader` type was `AppClassLoader` 
    ClassLoader pluginLoader = inner.get(inner.lastKey());
    return pluginLoader instanceof PluginClassLoader
           ? (PluginClassLoader) pluginLoader
           : null;
}

public ClassLoader connectorLoader(Connector connector) {
    return connectorLoader(connector.getClass().getName());
}

public ClassLoader connectorLoader(String connectorClassOrAlias) {
    log.debug("Getting plugin class loader for connector: '{}'", 
connectorClassOrAlias);
    String fullName = aliases.containsKey(connectorClassOrAlias)
                      ? aliases.get(connectorClassOrAlias)
                      : connectorClassOrAlias;
    PluginClassLoader classLoader = pluginClassLoader(fullName);
    if (classLoader == null) {
        log.error(
                "Plugin class loader for connector: '{}' was not found. 
Returning: {}",
                connectorClassOrAlias,
                this
        );
        return this;
    }
    return classLoader;
}

}

{code}
Looking at the code, I found that in the code of 
`DelegatingClassLoader#PluginClassLoader()`, the type of variable pluginLoader 
is AppClassLoader, which will result in returning null and output 
log.error(...), but no exception is thrown.


But it doesn't seem to cause mm2 to be unavailable, so I think it might be a 
wrong log output.

 

> Plugin class loader not found using MM2
> ---------------------------------------
>
>                 Key: KAFKA-9376
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9376
>             Project: Kafka
>          Issue Type: Bug
>          Components: mirrormaker
>    Affects Versions: 2.4.0
>            Reporter: Sinóros-Szabó Péter
>            Priority: Minor
>
> I am using MM2 (release 2.4.0 with scala 2.12) I geta bunch of classloader 
> errors. MM2 seems to be working, but I do not know if all of it components 
> are working as expected as this is the first time I use MM2.
> I run MM2 with the following command:
> {code:java}
> ./bin/connect-mirror-maker.sh config/connect-mirror-maker.properties
> {code}
> Errors are:
> {code:java}
> [2020-01-07 15:06:17,892] ERROR Plugin class loader for connector: 
> 'org.apache.kafka.connect.mirror.MirrorHeartbeatConnector' was not found. 
> Returning: 
> org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader@6ebf0f36 
> (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:165)
> [2020-01-07 15:06:17,889] ERROR Plugin class loader for connector: 
> 'org.apache.kafka.connect.mirror.MirrorHeartbeatConnector' was not found. 
> Returning: 
> org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader@6ebf0f36 
> (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader:165)
> [2020-01-07 15:06:17,904] INFO ConnectorConfig values:
>  config.action.reload = restart
>  connector.class = org.apache.kafka.connect.mirror.MirrorHeartbeatConnector
>  errors.log.enable = false
>  errors.log.include.messages = false
>  errors.retry.delay.max.ms = 60000
>  errors.retry.timeout = 0
>  errors.tolerance = none
>  header.converter = null
>  key.converter = null
>  name = MirrorHeartbeatConnector
>  tasks.max = 1
>  transforms = []
>  value.converter = null
>  (org.apache.kafka.connect.runtime.ConnectorConfig:347)
> [2020-01-07 15:06:17,904] INFO EnrichedConnectorConfig values:
>  config.action.reload = restart
>  connector.class = org.apache.kafka.connect.mirror.MirrorHeartbeatConnector
>  errors.log.enable = false
>  errors.log.include.messages = false
>  errors.retry.delay.max.ms = 60000
>  errors.retry.timeout = 0
>  errors.tolerance = none
>  header.converter = null
>  key.converter = null
>  name = MirrorHeartbeatConnector
>  tasks.max = 1
>  transforms = []
>  value.converter = null
>  
> (org.apache.kafka.connect.runtime.ConnectorConfig$EnrichedConnectorConfig:347)
> [2020-01-07 15:06:17,905] INFO TaskConfig values:
>  task.class = class org.apache.kafka.connect.mirror.MirrorHeartbeatTask
>  (org.apache.kafka.connect.runtime.TaskConfig:347)
> [2020-01-07 15:06:17,905] INFO Instantiated task MirrorHeartbeatConnector-0 
> with version 1 of type org.apache.kafka.connect.mirror.MirrorHeartbeatTask 
> (org.apache.kafka.connect.runtime.Worker:434){code}
> After a while, these errors are not logged any more.
> Config is:
> {code:java}
> clusters = eucmain, euwbackup
> eucmain.bootstrap.servers = kafka1:9092,kafka2:9092
> euwbackup.bootstrap.servers = 172.30.197.203:9092,172.30.213.104:9092
> eucmain->euwbackup.enabled = true
> eucmain->euwbackup.topics = .*
> eucmain->euwbackup.topics.blacklist = ^(kafka|kmf|__|pricing).*
> eucmain->euwbackup.rename.topics = false
> rename.topics = false
> eucmain->euwbackup.sync.topic.acls.enabled = false
> sync.topic.acls.enabled = false{code}
> Using OpenJDK 8 or 11, I get the same error.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to