Skip to content

Commit

Permalink
[LOG4J2-703] Android: Could not find class 'javax.naming.InitialConte…
Browse files Browse the repository at this point in the history
…xt', referenced from method org.apache.logging.log4j.core.lookup.JndiLookup.lookup.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1609378 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
garydgregory committed Jul 10, 2014
1 parent ede7b0b commit 3203d3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ public Interpolator(final Map<String, String> properties) {
// 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")) {
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 3203d3e

Please sign in to comment.