Skip to content

Commit e1e0905

Browse files
author
Harsh J
committed
MAPREDUCE-6213. NullPointerException caused by job history server addr not resolvable. Contributed by Peng Zhang.
1 parent 7a678db commit e1e0905

File tree

2 files changed

+7
-3
lines changed
  • hadoop-mapreduce-project

2 files changed

+7
-3
lines changed

hadoop-mapreduce-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ Release 2.8.0 - UNRELEASED
286286

287287
BUG FIXES
288288

289+
MAPREDUCE-6213. NullPointerException caused by job history server addr not
290+
resolvable. (Peng Zhang via harsh)
291+
289292
MAPREDUCE-6281. Fix javadoc in Terasort. (Albert Chu via ozawa)
290293

291294
Release 2.7.0 - UNRELEASED

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRWebAppUtil.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ public static String getApplicationWebURLOnJHSWithoutScheme(Configuration conf,
137137
hsAddress, getDefaultJHSWebappPort(),
138138
getDefaultJHSWebappURLWithoutScheme());
139139
StringBuffer sb = new StringBuffer();
140-
if (address.getAddress().isAnyLocalAddress() ||
141-
address.getAddress().isLoopbackAddress()) {
140+
if (address.getAddress() != null &&
141+
(address.getAddress().isAnyLocalAddress() ||
142+
address.getAddress().isLoopbackAddress())) {
142143
sb.append(InetAddress.getLocalHost().getCanonicalHostName());
143144
} else {
144145
sb.append(address.getHostName());
@@ -171,4 +172,4 @@ private static String getDefaultJHSWebappURLWithoutScheme() {
171172
public static String getAMWebappScheme(Configuration conf) {
172173
return "http://";
173174
}
174-
}
175+
}

0 commit comments

Comments
 (0)