nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santosh Pingale <pingalesant...@gmail.com>
Subject NiFi v1.1.1 - org.apache.nifi.controller.FlowController cannot be cast to org.apache.nifi.controller.FlowController
Date Tue, 18 Jul 2017 22:30:18 GMT
Hi there

I am stuck with v1.1.1 with no way to upgrade it until admin gets around it
to do it.

I want to send ProcessorGroup level metrics via statsd. However, in v1.1.1
EventAcess does not have getGroupStatus method which, I believe, was
included in 1.2.0. Upon some code inspection, I found out that,
FlowController implements EventAccess and FlowController has method
necessary. But, ReportingTask only has access of methods defined by
EvenAccess directly, so I tried to type cast EventAccess to FlowController
in onTrigger.

@Override
public void onTrigger(final ReportingContext context) {

final FlowController controller = (FlowController) context.getEventAccess();

final ProcessGroupStatus pgStatus = controller.getGroupStatus(processGroupID);

}

When I tried to run this in NiFi instance, I get weird class cast exception.
org.apache.nifi.controller.FlowController cannot be cast to
org.apache.nifi.controller.FlowController

It was very confusing in the beginning but it might be because of multiple
class loaders.

Is there any way to this? Although there are ways like accessing rest apis,
I am curious to know what exactly is happening here. If there are indeed
multiple class loaders, can someone explain how can we access EventAccess
in the first place despite there being multiple class loaders but type
casting fails.

Mime
View raw message