This is an automated email from the ASF dual-hosted git repository.
turcsanyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new d15eeb445b NIFI-11342: HDFS processors fail to get
ClassloaderIsolationKey at startup
d15eeb445b is described below
commit d15eeb445bf38905166dc50a012dcd2787f62646
Author: Mark Bathori <[email protected]>
AuthorDate: Tue Apr 4 16:42:35 2023 +0200
NIFI-11342: HDFS processors fail to get ClassloaderIsolationKey at startup
This closes #7121.
Signed-off-by: Peter Turcsanyi <[email protected]>
---
.../processors/hadoop/AbstractHadoopProcessor.java | 24 +++++++++++++---------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git
a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
index a967b9037a..f594ed2549 100644
---
a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
+++
b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
@@ -211,18 +211,22 @@ public abstract class AbstractHadoopProcessor extends
AbstractProcessor implemen
return explicitKerberosPrincipal;
}
- final KerberosCredentialsService credentialsService =
context.getProperty(KERBEROS_CREDENTIALS_SERVICE).asControllerService(KerberosCredentialsService.class);
- if (credentialsService != null) {
- final String credentialsServicePrincipal =
credentialsService.getPrincipal();
- if (credentialsServicePrincipal != null) {
- return credentialsServicePrincipal;
+ try {
+ final KerberosCredentialsService credentialsService =
context.getProperty(KERBEROS_CREDENTIALS_SERVICE).asControllerService(KerberosCredentialsService.class);
+ if (credentialsService != null) {
+ final String credentialsServicePrincipal =
credentialsService.getPrincipal();
+ if (credentialsServicePrincipal != null) {
+ return credentialsServicePrincipal;
+ }
}
- }
- final KerberosUserService kerberosUserService =
context.getProperty(KERBEROS_USER_SERVICE).asControllerService(KerberosUserService.class);
- if (kerberosUserService != null) {
- final KerberosUser kerberosUser =
kerberosUserService.createKerberosUser();
- return kerberosUser.getPrincipal();
+ final KerberosUserService kerberosUserService =
context.getProperty(KERBEROS_USER_SERVICE).asControllerService(KerberosUserService.class);
+ if (kerberosUserService != null) {
+ final KerberosUser kerberosUser =
kerberosUserService.createKerberosUser();
+ return kerberosUser.getPrincipal();
+ }
+ } catch (IllegalStateException e) {
+ return null;
}
return null;