Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.13.3
-
None
-
None
-
This code was called in dockerized springboot application so environment recreating is not easy, but error seems to be pretty obvious.
Description
Exception is thrown at line 92 of class Log4j2CloudConfigLoggingSystem.
Reason is pretty simple:
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]); }
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]