Преглед на файлове

Improved error message when job jar not found. Contributed by Michel.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@433327 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting преди 18 години
родител
ревизия
886a680e16
променени са 2 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 3 0
      CHANGES.txt
  2. 8 1
      src/java/org/apache/hadoop/util/RunJar.java

+ 3 - 0
CHANGES.txt

@@ -58,6 +58,9 @@ Trunk (unreleased changes)
     class, for improved handling of UTF-8 data.
     (Milind Bhandarkar via cutting)
 
+14. HADOOP-464.  Improved error message when job jar not found.
+    (Michel Tourn via cutting)
+
 
 Release 0.5.0 - 2006-08-04
 

+ 8 - 1
src/java/org/apache/hadoop/util/RunJar.java

@@ -75,7 +75,14 @@ public class RunJar {
     File file = new File(fileName);
     String mainClassName = null;
 
-    JarFile jarFile = new JarFile(fileName);
+    JarFile jarFile;
+    try {
+      jarFile = new JarFile(fileName);
+    } catch(IOException io) {
+      throw new IOException("Error opening job jar: " + fileName)
+        .initCause(io);
+    }
+
     Manifest manifest = jarFile.getManifest();
     if (manifest != null) {
       mainClassName = manifest.getMainAttributes().getValue("Main-Class");