hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r502749 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/StatusHttpServer.java
Date Fri, 02 Feb 2007 21:06:26 GMT
Author: cutting
Date: Fri Feb  2 13:06:25 2007
New Revision: 502749

URL: http://svn.apache.org/viewvc?view=rev&rev=502749
Log:
HADOOP-309.  Fix some NullPointerExceptions in the StatusHttpServer.  Contributed by navychen.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=502749&r1=502748&r2=502749
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Fri Feb  2 13:06:25 2007
@@ -143,6 +143,9 @@
 44. HADOOP-965.  Fix IsolationRunner so that job's jar can be found.
     (Dennis Kubes via cutting)
 
+45. HADOOP-309.  Fix two NullPointerExceptions in StatusHttpServer.
+    (navychen via cutting)
+
 
 Release 0.10.1 - 2007-01-10
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java?view=diff&rev=502749&r1=502748&r2=502749
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/StatusHttpServer.java Fri Feb  2
13:06:25 2007
@@ -70,13 +70,15 @@
     listener.setHost(bindAddress);
     webServer.addListener(listener);
 
-    // set up the context for "/logs/"
-    HttpContext logContext = new HttpContext();
-    logContext.setContextPath("/logs/*");
+    // set up the context for "/logs/" if "hadoop.log.dir" property is defined. 
     String logDir = System.getProperty("hadoop.log.dir");
-    logContext.setResourceBase(logDir);
-    logContext.addHandler(new ResourceHandler());
-    webServer.addContext(logContext);
+    if( logDir != null ) {
+      HttpContext logContext = new HttpContext();
+      logContext.setContextPath("/logs/*");
+      logContext.setResourceBase(logDir);
+      logContext.addHandler(new ResourceHandler());
+      webServer.addContext(logContext);
+    }
 
     // set up the context for "/static/*"
     String appDir = getWebAppsPath();
@@ -151,6 +153,8 @@
    */
   private static String getWebAppsPath() throws IOException {
     URL url = StatusHttpServer.class.getClassLoader().getResource("webapps");
+    if( url == null ) 
+      throw new IOException("webapps not found in CLASSPATH"); 
     String path = url.getPath();
     if (isWindows && path.startsWith("/")) {
       path = path.substring(1);



Mime
View raw message