Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3203d3e

Browse files
committed
[LOG4J2-703] Android: Could not find class 'javax.naming.InitialContext', 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
1 parentede7b0b commit3203d3e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ public Interpolator(final Map<String, String> properties) {
7272
// TODO: this ought to use the PluginManager
7373
lookups.put("sys",newSystemPropertiesLookup());
7474
lookups.put("env",newEnvironmentLookup());
75-
lookups.put("jndi",newJndiLookup());
75+
try {
76+
lookups.put("jndi",newJndiLookup());
77+
}catch (Exceptione) {
78+
// [LOG4J2-703] We might be on Android
79+
// java.lang.VerifyError: org/apache/logging/log4j/core/lookup/JndiLookup
80+
LOGGER.warn(
81+
"JNDI lookup class is not available because this JRE does not support JNDI. JNDI string lookups will not be available, continuing configuration.",
82+
e);
83+
}
7684
lookups.put("date",newDateLookup());
7785
lookups.put("ctx",newContextMapLookup());
7886
if (Loader.isClassAvailable("javax.servlet.ServletContext")) {

‎src/changes/changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
</properties>
2323
<body>
2424
<releaseversion="2.0-???"date="2014-0M-DD"description="Bug fixes and enhancements">
25+
<actionissue="LOG4J2-703"dev="ggregory"type="fix"due-to="Nelson Melina">
26+
Android: Could not find class 'javax.naming.InitialContext', referenced from method org.apache.logging.log4j.core.lookup.JndiLookup.lookup.
27+
</action>
2528
<actionissue="LOG4J2-696"dev="ggregory"type="add">
2629
RegexFilter does not match multiline log messages.
2730
</action>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp