[ 
https://issues.apache.org/jira/browse/KAFKA-7346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

KP updated KAFKA-7346:
----------------------
    Issue Type: Bug  (was: Improvement)

> Cannot run Kafka Connect within a web application
> -------------------------------------------------
>
>                 Key: KAFKA-7346
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7346
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>    Affects Versions: 1.1.1
>            Reporter: KP
>            Priority: Major
>
> The Plugins class loads plugins using DelegatingClassLoader whose parent 
> class loader is Application class loader.
> public DelegatingClassLoader(List<String> pluginPaths) {
>     this(pluginPaths, ClassLoader.getSystemClassLoader()); //-> Application 
> class loader
> }
> When running Kafka Connect within tomcat web applications, 
> Plugins#pluginClass always throws ClassNotFoundException because 
> "pluginClass" is loaded not by Application class loader but by 
> ParallelWebAppClassLoader.
> protected static Class pluginClass(...){
>     Class<?> klass = loader.loadClass(classOrAlias, false);
>     if (pluginClass.isAssignableFrom(klass)) {    // -> returns false
>         return (Class<? extends U>) klass;
>     }
>      throw new ClassNotFoundException(...);
> }
>  
> Here is the class loader hierarchy when using JsonConverter:
> Converter
>     -ParallelWebAppClassLoader
>         - URLClassLoader (parent)
>             -Launcher$AppClassLoader (parent)
> JsonConverter
>     -PluginClassLoader
>         -DelegatingClassLoader(parent)
>             -Launher$AppClassLoader
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to