HBASE-12108 | Setting classloader so that HBase resources resolve even when HBaseConfiguration is loaded from a different class loader
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
44596148c7
commit
0fa6eedcdb
|
@ -89,6 +89,10 @@ public class HBaseConfiguration extends Configuration {
|
||||||
*/
|
*/
|
||||||
public static Configuration create() {
|
public static Configuration create() {
|
||||||
Configuration conf = new Configuration();
|
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);
|
return addHbaseResources(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue