diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java index f2ce848ec5..1ce13c3837 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java @@ -420,9 +420,9 @@ public class StandardControllerServiceNode extends AbstractComponentNode impleme final ValidationStatus validationStatus = getValidationStatus(); if (validationStatus != ValidationStatus.VALID) { - LOG.debug("Cannot enable {} because it is not currently valid. Will try again in 5 seconds", StandardControllerServiceNode.this); - scheduler.schedule(this, 5, TimeUnit.SECONDS); - future.completeExceptionally(new ControllerServiceNotValidException(this + " cannot be enabled because it is not currently valid. Will try again in 5 seconds.")); + LOG.debug("Cannot enable {} because it is not currently valid. (Validation State is {}). Will try again in 1 second", StandardControllerServiceNode.this, getValidationState()); + scheduler.schedule(this, 1, TimeUnit.SECONDS); + future.complete(null); return; } @@ -569,19 +569,14 @@ public class StandardControllerServiceNode extends AbstractComponentNode impleme @Override public String toString() { - String bundleCoordinate; - try { - bundleCoordinate = controllerServiceHolder.get().getBundleCoordinate().toString(); - } catch (NullPointerException e) { - bundleCoordinate = "null"; - } - return "StandardControllerServiceNode{" + - "controllerServiceHolder=" + bundleCoordinate + + final ControllerServiceDetails details = controllerServiceHolder.get(); + final String bundleCoordinate = details == null ? "null" : String.valueOf(details.getBundleCoordinate()); + return "StandardControllerServiceNode[" + + "service=" + super.toString() + ", versionedComponentId=" + versionedComponentId + - ", comment='" + comment + '\'' + ", processGroup=" + processGroup + ", active=" + active + - '}'; + ']'; } @Override diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/config/IllegalArgumentExceptionMapper.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/config/IllegalArgumentExceptionMapper.java index e9edd8f092..5151a41f76 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/config/IllegalArgumentExceptionMapper.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/config/IllegalArgumentExceptionMapper.java @@ -16,12 +16,12 @@ */ package org.apache.nifi.web.api.config; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; -import org.apache.nifi.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Maps web application exceptions into client responses. @@ -34,8 +34,7 @@ public class IllegalArgumentExceptionMapper implements ExceptionMapper