markthegrea
markthegrea

Reputation: 3851

Why doesn't my NiFi Nar show up in the processor list?

Just made my first NAR from a tutorial, put it in the /lib file and restarted NiFi. The Processor shows up as loaded in the logs but does not show up in the processor list. Any ideas?

Tutorial: http://www.nifi.rocks/developing-a-custom-apache-nifi-processor-json/

        @SideEffectFree
        @Tags({"JSON", "NIFI ROCKS"})
        @CapabilityDescription("Fetch value from json path.")
        public class JsonProcessor extends AbstractProcessor {
           ...
        }

Edit: I see two lines in the logs with this in it:

2017-07-06 19:34:06,200 INFO [main] org.apache.nifi.nar.NarClassLoaders Loaded NAR file: C:\UserApps\NIFI-1~1.0\.\work\nar\extensions\examples-1.0-SNAPSHOT.nar-unpacked as class loader org.apache.nifi.nar.NarClassLoader[.\work\nar\extensions\examples-1.0-SNAPSHOT.nar-unpacked]

What should the processor be called in the list? JsonProcessor?

Edit:

Tried changing the <nifi.version>1.3.0</nifi.version> in the pom from 1.2.0 to 1.3.0. No joy.

Upvotes: 3

Views: 3020

Answers (2)

Goke Obasa
Goke Obasa

Reputation: 4898

I also used this tutorial to create a Customer Processor. The issue I had was that I mixed up the ./lib directory.

When you start Apache Nifi, you would notice the following at the beginning of the log:

Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
NiFi home: /usr/local/Cellar/nifi/1.6.0/libexec

Confirm that the NAR file is the $NIFI_HOME/libexec/lib folder which would be /usr/local/Cellar/nifi/1.6.0/libexec/lib in my case.

I hope this helps

NB: I ran Apache Nifi on a Mac, logs might be different on another OS

Upvotes: 0

markthegrea
markthegrea

Reputation: 3851

So on top of coding up the program you must put a file called

org.apache.nifi.processor.Processor

in YOUR project to get it to show up. I would suspect NiFi would scan for the classes with the annotations but alas, it does not. Probably some security thing.

NiFi processor program structure

The tutorial above does have this in it. "Browsing" got me again!

Upvotes: 5

Related Questions