From b0ecfee1ab97d5247c4a6ca08618f988a4dde6a2 Mon Sep 17 00:00:00 2001 From: Stas Sukhanov Date: Sat, 28 Jul 2018 01:23:09 +0200 Subject: [PATCH] Fix ClassNotFoundException in druid-kerberos extension (#4776) Class org.apache.hadoop.conf.Configuration inside extensions should be used with caution. By default, the configuration uses the context class loader of the current thread set to the class loader used to load the application. Because of isolation between the application and extensions we must explicitely set the class loader to extension class loader to be able load classes specified in hadoop configuration file. --- .../main/java/io/druid/security/kerberos/DruidKerberosUtil.java | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions-core/druid-kerberos/src/main/java/io/druid/security/kerberos/DruidKerberosUtil.java b/extensions-core/druid-kerberos/src/main/java/io/druid/security/kerberos/DruidKerberosUtil.java index b8de70bc6d3..e23d85cc668 100644 --- a/extensions-core/druid-kerberos/src/main/java/io/druid/security/kerberos/DruidKerberosUtil.java +++ b/extensions-core/druid-kerberos/src/main/java/io/druid/security/kerberos/DruidKerberosUtil.java @@ -95,6 +95,7 @@ public class DruidKerberosUtil { if (!Strings.isNullOrEmpty(internalClientPrincipal) && !Strings.isNullOrEmpty(internalClientKeytab)) { Configuration conf = new Configuration(); + conf.setClassLoader(DruidKerberosModule.class.getClassLoader()); conf.set(CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); try {