logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1609378 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java src/changes/changes.xml
Date Thu, 10 Jul 2014 03:20:34 GMT
Author: ggregory
Date: Thu Jul 10 03:20:34 2014
New Revision: 1609378

URL: http://svn.apache.org/r1609378
Log:
[LOG4J2-703] Android: Could not find class 'javax.naming.InitialContext', referenced from
method org.apache.logging.log4j.core.lookup.JndiLookup.lookup.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java?rev=1609378&r1=1609377&r2=1609378&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java
Thu Jul 10 03:20:34 2014
@@ -72,7 +72,15 @@ public class Interpolator implements Str
         // TODO: this ought to use the PluginManager
         lookups.put("sys", new SystemPropertiesLookup());
         lookups.put("env", new EnvironmentLookup());
-        lookups.put("jndi", new JndiLookup());
+        try {
+            lookups.put("jndi", new JndiLookup());
+        } catch (Exception e) {
+            // [LOG4J2-703] We might be on Android
+            // java.lang.VerifyError: org/apache/logging/log4j/core/lookup/JndiLookup
+            LOGGER.warn(
+                    "JNDI lookup class is not available because this JRE does not support
JNDI. JNDI string lookups will not be available, continuing configuration.",
+                    e);
+        }
         lookups.put("date", new DateLookup());
         lookups.put("ctx", new ContextMapLookup());
         if (Loader.isClassAvailable("javax.servlet.ServletContext")) {

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1609378&r1=1609377&r2=1609378&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Thu Jul 10 03:20:34 2014
@@ -22,6 +22,9 @@
   </properties>
   <body>
     <release version="2.0-???" date="2014-0M-DD" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-703" dev="ggregory" type="fix" due-to="Nelson Melina">
+        Android: Could not find class 'javax.naming.InitialContext', referenced from method
org.apache.logging.log4j.core.lookup.JndiLookup.lookup.
+      </action>
       <action issue="LOG4J2-696" dev="ggregory" type="add">
         RegexFilter does not match multiline log messages.
       </action>



Mime
View raw message