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

Andrejus Chaliapinas commented on LOG4J2-2104:
----------------------------------------------

Sorry for delay, please give me few more days here to respond fully as busy 
with some other things.

But some quick comments:
#1 - fix is needed here to eliminate addition of same classloader twice, 
especially having possibility of twice exception based on current fix in master.
#2 - change delivered under  LOG4J2-2055:
-            loadProviders(classLoader);
+            try {
+                loadProviders(classLoader);
+            } catch (Throwable ex) {
+                LOGGER.debug("Unable to retrieve provider from ClassLoader 
{}", classLoader, ex);
+            }

looks right now as a workaround right now rather than correct fix.

But I'll try master and see if what it will print will be about already 
discussed java.util.ServiceConfigurationError or anything else.

Will update more till the end of this week. Sorry once again for delay with my 
response.

> LoaderUtil getClassLoaders() method and while loops
> ---------------------------------------------------
>
>                 Key: LOG4J2-2104
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2104
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.9.1
>            Reporter: Andrejus Chaliapinas
>            Assignee: Ralph Goers
>            Priority: Minor
>
> For v2.9.1 inside org.apache.logging.log4j.util.LoaderUtil and 
> getClassLoaders() method we have lines 120-123 as such:
> ClassLoader parent = tcl;
> while (parent != null && !classLoaders.contains(parent)) {
>     classLoaders.add(parent);
> }
> where it looks like some getParent() call is either missing or otherwise 
> "while" loop is not needed.
> In line 111 tcl classloader already added into list of clasloaders:
> classLoaders.add(tcl);
> Was it an attempt to add all classloaders hierarchy or just some immediate 
> parents?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to