From 0fa6eedcdb3e446567c7581584c060852cedcbad 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 77793998896..1323240719f 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 @@ -89,6 +89,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); }