Rafał Figas created LOG4J2-2943:
-----------------------------------

             Summary: Exception in Log4j2CloudConfigLoggingSystem
                 Key: LOG4J2-2943
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2943
             Project: Log4j 2
          Issue Type: Bug
          Components: Spring
    Affects Versions: 2.13.3
         Environment: This code was called in dockerized springboot application 
so environment recreating is not easy, but error seems to be pretty obvious.
            Reporter: Rafał Figas


Exception is thrown at line 92 of class Log4j2CloudConfigLoggingSystem.

Reason is pretty simple:
{noformat}
        String location = 
props.getStringProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
        if (location != null) {
            List<String> list = 
Arrays.asList(super.getStandardConfigLocations());
            list.add(location);
            locations = list.toArray(new String[0]);
        }
{noformat}
Method {{Arrays.asList()}} returns *fixed size list*, so the next line call 
{{list.add(location);}} causes exception:

java.lang.UnsupportedOperationException: null
 at java.util.AbstractList.add(AbstractList.java:148) ~[?:1.8.0_265]
 at java.util.AbstractList.add(AbstractList.java:108) ~[?:1.8.0_265]
 at 
org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.getStandardConfigLocations(Log4j2CloudConfigLoggingSystem.java:92)
 ~[log4j-spring-cloud-config-client-2.13.3.jar:2.13.3]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to