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

Alex commented on FLINK-12143:
------------------------------

The problem is because
 * {{parentFirstLoaderPatterns}} contains {{org.apache.flink.}} as matching 
prefix;
 * the hadoop file system component loads some classes dynamically 
({{java.lang.Class.forName}}) and one of them 
{{org.apache.flink.fs.shaded.hadoop3.org.apache.commons.configuration2.PropertiesConfiguration}}
 matches the pattern.
This triggers to use the application global class loader, instead of searching 
in the jar.


The test failure can be reproduced by slightly modifying {{PluginLoaderTest}}:

setting the matching {{loaderExcludePatterns}} on [line 
42|[https://github.com/apache/flink/blob/master/flink-tests/src/test/java/org/apache/flink/test/plugin/PluginLoaderTest.java#L42]].
 For example to:
{code:java}
// Use explicit prefix of org.apache.flink.test.plugin.jar.plugina.DynamicClassA
PluginDescriptor pluginDescriptorA = new PluginDescriptor("A", new 
URL[]{classpathA}, new String[]{"org.apache.flink."});
{code}
 
Although, running this test in IDE would not throw {{ClassNotFound}} exception, 
but the actual class lookup would use the global class loader.

> Mechanism to ship plugin jars in the cluster
> --------------------------------------------
>
>                 Key: FLINK-12143
>                 URL: https://issues.apache.org/jira/browse/FLINK-12143
>             Project: Flink
>          Issue Type: Sub-task
>          Components: FileSystems, Runtime / Coordination
>            Reporter: Stefan Richter
>            Assignee: Alex
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.9.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




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

Reply via email to