You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by "Thomas Weise (JIRA)" <ji...@apache.org> on 2017/07/21 08:25:00 UTC
[jira] [Commented] (APEXCORE-767) Duplicate class loading in CLI
for single application launch
[ https://issues.apache.org/jira/browse/APEXCORE-767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095953#comment-16095953 ]
Thomas Weise commented on APEXCORE-767:
---------------------------------------
Following change to use existing context class loader as parent resolved the issue:
{code}
diff --git a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
index d4f0170f3..305502de6 100644
--- a/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
+++ b/engine/src/main/java/com/datatorrent/stram/client/StramAppLauncher.java
@@ -535,7 +535,7 @@ public class StramAppLauncher
public URLClassLoader loadDependencies()
{
- URLClassLoader cl = URLClassLoader.newInstance(launchDependencies.toArray(new URL[launchDependencies.size()]));
+ URLClassLoader cl = URLClassLoader.newInstance(launchDependencies.toArray(new URL[launchDependencies.size()]), Thread.currentThread().getContextClassLoader());
Thread.currentThread().setContextClassLoader(cl);
StringCodecs.check();
return cl;
{code}
> Duplicate class loading in CLI for single application launch
> -------------------------------------------------------------
>
> Key: APEXCORE-767
> URL: https://issues.apache.org/jira/browse/APEXCORE-767
> Project: Apache Apex Core
> Issue Type: Bug
> Reporter: Thomas Weise
>
> StramAppLauncher will create multiple class loaders in a way that leads to duplicate loading of the same class (while listing app package, then when launching). It also appears that the context class loader is never reset.
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)