[ https://issues.apache.org/jira/browse/APEXCORE-767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16096983#comment-16096983 ]
ASF GitHub Bot commented on APEXCORE-767: ----------------------------------------- florianschmidt1994 opened a new pull request #563: APEXCORE-767.set parent classloader in StramAppLauncher.loadDependencies URL: https://github.com/apache/apex-core/pull/563 StramAppLauncher.loadDependencies is called multiple times when starting an application via the apex-cli with the -local option. In each of the calls to loadDependencies, the contextClassLoader of the current thread would be replaced with a new instance of URLClassLoader (which has no parent class loader set). This can lead to issues, e.g. when one aquires the current contextClassLauncher, loads a class with it and tries to cast it to a class which was loaded with a previous version of the contextClassLoader, resulting in a ClassCastException. An example of this bug can be seen in APEXMALHAR-2511 The changes in this commit fix this by passing the parent class loader for each new instance of URLClassLoader to the current contextClassLoader ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > Assignee: Florian Schmidt > > 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)