NIFI-1164: Fixed contrib-check issues, log message

This commit is contained in:
Mark Payne 2015-12-31 15:37:00 -05:00
parent 71544cd22b
commit 8e031c987b
1 changed files with 6 additions and 2 deletions

View File

@ -292,11 +292,15 @@ public class StandardControllerServiceNode extends AbstractConfiguredComponent i
stateRef.set(ControllerServiceState.DISABLED);
}
} catch (Exception e) {
final Throwable cause = e instanceof InvocationTargetException ? e.getCause() : e;
final ComponentLog componentLog = new SimpleProcessLogger(getIdentifier(), StandardControllerServiceNode.this);
componentLog.error("Failed to invoke @OnEnabled method due to {}", cause);
LOG.error("Failed to invoke @OnEnabled method of {} due to {}", getControllerServiceImplementation(), cause.toString());
invokeDisable(configContext, heartbeater);
if (isActive()) {
scheduler.schedule(this, administrativeYieldMillis, TimeUnit.MILLISECONDS);
}
else {
} else {
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnDisabled.class, getControllerServiceImplementation(), configContext);
stateRef.set(ControllerServiceState.DISABLED);
}