You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/02/08 22:19:32 UTC
[logging-log4j2] branch master updated: Log4j 2LOG4J2-2770 Fix NPE
in JMX reconfiguration (#337)
This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new 9c9c444 Log4j 2LOG4J2-2770 Fix NPE in JMX reconfiguration (#337)
9c9c444 is described below
commit 9c9c44416a7be82e3270d0d1405e0a44ad93b810
Author: Bill Kuker <bk...@billkuker.com>
AuthorDate: Sat Feb 8 17:19:22 2020 -0500
Log4j 2LOG4J2-2770 Fix NPE in JMX reconfiguration (#337)
* Update ConfigurationSource.java
I think this needs to store the data so that resetInputStream() works.
The jmx function LoggerContextAdmin::getConfigText throws a NPE if you have previously called LoggerContextAdmin::setConfigText
* Do not set data if URL is provided
Avoids changing behavior of resetInputStream in cases that currently
work correctly.
---
.../java/org/apache/logging/log4j/core/config/ConfigurationSource.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
index 180043d..087d447 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
@@ -147,6 +147,9 @@ public class ConfigurationSource {
this.url = url;
this.location = null;
this.lastModified = lastModified;
+ if ( url == null ) {
+ this.data = data;
+ }
}
/**