streamr-dev / streamr-nifi

NiFi processors for subscribing and publishing to Streamr
Apache License 2.0
4 stars 0 forks source link

NullPointerException #1

Closed mabdi closed 5 years ago

mabdi commented 5 years ago

I'm getting this error when I run the StreamrSubscribe:

2019-08-20 11:22:11,737 INFO [NiFi Web Server-88] o.a.n.c.s.StandardProcessScheduler Starting StreamrSubscribe[id=ab9a9e11-016c-1000-6aa9-4eb3b62b4983]
2019-08-20 11:22:11,738 INFO [NiFi Web Server-88] o.a.n.c.s.StandardProcessScheduler Starting LogMessage[id=ac40546b-016c-1000-c511-331bce8cab4e]
2019-08-20 11:22:11,745 INFO [Timer-Driven Process Thread-10] o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled LogMessage[id=ac40546b-016c-1000-c511-331bce8cab4e] to run with 1 threads
2019-08-20 11:22:11,746 INFO [NiFi Web Server-88] o.a.n.c.s.StandardProcessScheduler Starting DebugFlow[id=abbcd209-016c-1000-f658-a2aec60a1548]
2019-08-20 11:22:11,781 INFO [Timer-Driven Process Thread-1] o.a.n.c.s.TimerDrivenSchedulingAgent Scheduled DebugFlow[id=abbcd209-016c-1000-f658-a2aec60a1548] to run with 1 threads
2019-08-20 11:22:12,221 INFO [Flow Service Tasks Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@19fddb2b // Another save pending = false
2019-08-20 11:22:12,395 ERROR [Timer-Driven Process Thread-6] S.p.StreamrNifi.StreamrSubscribe StreamrSubscribe[id=ab9a9e11-016c-1000-6aa9-4eb3b62b4983] Failed to properly initialize Processor. If still scheduled to run, NiFi will attempt to initialize and run the Processor again after the 'Administrative Yield Duration' has elapsed. Failure is due to java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException: null
    at Streamrlabs.processors.StreamrNifi.StreamrSubscribe.setStream(StreamrSubscribe.java:232)
    at Streamrlabs.processors.StreamrNifi.StreamrSubscribe.onScheduled(StreamrSubscribe.java:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:75)
    at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:52)
    at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1515)
    at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
2019-08-20 11:22:12,401 ERROR [Timer-Driven Process Thread-6] org.apache.nifi.util.ReflectionUtils Can not invoke method 'public void Streamrlabs.processors.StreamrNifi.StreamrSubscribe.onStopped(org.apache.nifi.processor.ProcessSession) throws java.io.IOException' with provided arguments since argument 0 of type 'interface org.apache.nifi.processor.ProcessSession' is not assignable from provided value of type 'class org.apache.nifi.processor.StandardProcessContext'.

Restarting the Processor didn't solve the problem (nor restarting Nifi). I'm using:

juslesan commented 5 years ago

Hi! It seems like you are getting the error on the setStream method. This should only happen if you have not configured your Stream id correctly. Are you pointing the id to a valid stream in Streamr? Also are you getting any specific errors in the NiFi processor on the canvas?

mabdi commented 5 years ago

Many thanks, Yes, I was using a key generated for a single stream. I update it with a key from setting.