From c812d13a471d4f8ee346fb3fc61f3d7763484b94 Mon Sep 17 00:00:00 2001 From: Aniket Bhatnagar Date: Tue, 13 Jan 2015 11:02:24 +0530 Subject: [PATCH] HBASE-12108 | Setting classloader so that HBase resources resolve even when HBaseConfiguration is loaded from a different class loader Signed-off-by: stack --- .../main/java/org/apache/hadoop/hbase/HBaseConfiguration.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java index 53e9392a836..34465819661 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HBaseConfiguration.java @@ -91,6 +91,10 @@ public class HBaseConfiguration extends Configuration { */ public static Configuration create() { Configuration conf = new Configuration(); + // In case HBaseConfiguration is loaded from a different classloader than + // Configuration, conf needs to be set with appropriate class loader to resolve + // HBase resources. + conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); return addHbaseResources(conf); }