From 42e20cbf60b8951ce78cdb77ff0f1d5159df7ad9 Mon Sep 17 00:00:00 2001 From: sparklezzz Date: Sun, 28 Nov 2021 09:25:51 +0800 Subject: [PATCH] fix(kerboros): set correct classloader for kerboros conf load in plugin tasks (#7027) Co-authored-by: xudong.zhang --- .../plugin/datasource/api/utils/CommonUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/utils/CommonUtils.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/utils/CommonUtils.java index 25b6a59d46..349638c2aa 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/utils/CommonUtils.java +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/utils/CommonUtils.java @@ -79,7 +79,9 @@ public class CommonUtils { * @throws IOException errors */ public static void loadKerberosConf(String javaSecurityKrb5Conf, String loginUserKeytabUsername, String loginUserKeytabPath) throws IOException { - loadKerberosConf(javaSecurityKrb5Conf, loginUserKeytabUsername, loginUserKeytabPath, new Configuration()); + Configuration configuration = new Configuration(); + configuration.setClassLoader(configuration.getClass().getClassLoader()); + loadKerberosConf(javaSecurityKrb5Conf, loginUserKeytabUsername, loginUserKeytabPath, configuration); } /**