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

ASF subversion and git services commented on LOG4J2-2906:
---------------------------------------------------------

Commit 5471d9a7d7600876920f7ebf318ff4ed8e5a59a5 in logging-log4j2's branch 
refs/heads/master from Ralph Goers
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=5471d9a ]

LOG4J2-2906 - Fix UnsupportedOperationException


> Log4j2 Cloud Config Logging System can't load config
> ----------------------------------------------------
>
>                 Key: LOG4J2-2906
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2906
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 2.13.2
>            Reporter: Stephen Joyner
>            Priority: Major
>
> When the Log4j2CloudConfigLoggingSystem class runs the 
> getStandardConfigLocations() method, if the log4j.configurationFile property 
> is set, a StackTrace will be thrown. This happens because Arrays.asList() is 
> used to convert the String[] to a list, but the list that is returned cannot 
> be modified using any methods that would change the size of the array.
> {code:java}
> Exception in thread "Thread-18" 
> java.lang.UnsupportedOperationExceptionException in thread "Thread-18" 
> java.lang.UnsupportedOperationException at 
> java.util.AbstractList.add(AbstractList.java:148) at 
> java.util.AbstractList.add(AbstractList.java:108) at 
> org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.getStandardConfigLocations(Log4j2CloudConfigLoggingSystem.java:92)
>  at 
> org.springframework.boot.logging.AbstractLoggingSystem.getSelfInitializationConfig(AbstractLoggingSystem.java:93)
>  at 
> org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:70)
>  at 
> org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
>  at 
> org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:144)
>  at 
> org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.initialize(Log4j2CloudConfigLoggingSystem.java:82)
>  at 
> org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:289)
>  at 
> org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:264)
>  at 
> org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:226)
>  at 
> org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:203)
>  at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
>  at 
> org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:76)
>  at 
> org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
>  at 
> org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:342)
>  at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
> {code}



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

Reply via email to