You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by je...@apache.org on 2014/12/10 04:30:29 UTC

[19/27] tez git commit: TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader in not pointing to Tez jars. (Johannes Zillmann via hitesh)

TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader in not pointing to Tez jars. (Johannes Zillmann via hitesh)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/991d3d38
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/991d3d38
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/991d3d38

Branch: refs/heads/TEZ-8
Commit: 991d3d3849119b4b667636a829dc5125d74623a3
Parents: 87b4c6b
Author: Hitesh Shah <hi...@apache.org>
Authored: Wed Dec 3 17:28:51 2014 -0800
Committer: Hitesh Shah <hi...@apache.org>
Committed: Wed Dec 3 17:28:51 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             |  2 ++
 .../main/java/org/apache/tez/common/VersionInfo.java    | 12 +++++-------
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/991d3d38/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1348ab0..5cae713 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -45,6 +45,8 @@ ALL CHANGES:
   TEZ-1774. AppLaunched event for Timeline does not have start time set.
   TEZ-1780. tez-api is missing jersey dependencies.
   TEZ-1796. Use of DeprecationDelta broke build against 2.2 Hadoop.
+  TEZ-1818. Problem loading tez-api-version-info.properties in case current context classloader
+    in not pointing to Tez jars.
 
 Release 0.5.2: 2014-11-07
 

http://git-wip-us.apache.org/repos/asf/tez/blob/991d3d38/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java b/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
index 0287d0b..b5e44c9 100644
--- a/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
+++ b/tez-api/src/main/java/org/apache/tez/common/VersionInfo.java
@@ -47,18 +47,16 @@ public class VersionInfo {
   protected VersionInfo(String component) {
     this.component = component;
     info = new Properties();
-    String versionInfoFile = component + "-version-info.properties";
+    String versionInfoFile = "/" + component + "-version-info.properties";
     InputStream is = null;
     try {
-      is = Thread.currentThread().getContextClassLoader()
-          .getResourceAsStream(versionInfoFile);
+      is = this.getClass().getResourceAsStream(versionInfoFile);
       if (is == null) {
-        throw new IOException("Resource not found");
+        throw new IOException("Resource not found: " + versionInfoFile);
       }
       info.load(is);
     } catch (IOException ex) {
-      LogFactory.getLog(getClass()).warn("Could not read '" +
-          versionInfoFile + "', " + ex.toString(), ex);
+      LOG.warn("Could not read '" + versionInfoFile + "', " + ex.toString(), ex);
     } finally {
       IOUtils.closeStream(is);
     }
@@ -86,7 +84,7 @@ public class VersionInfo {
         + ", version=" + getVersion()
         + ", revision=" + getRevision()
         + ", SCM-URL=" + getSCMURL()
-        + ", buildTIme=" + getBuildTime()
+        + ", buildTime=" + getBuildTime()
         + " ]";
   }