Thanks so much Bryan. It is running now. It is starting to come together but I'm still a little unclear on when to include nifi files to pick up dependencies and when to directly include the upstream dependencies. Like say some nifi nar like nifi-processor-utils already has a dependency on commons-lang3 and my custom processor needs commons-lang3, should I satisfy that by depending on nifi-processor-utils (which in know will already be in the install) or should I add a dependency on commons-lang3 in my nar and duplicate the libraries? I realize that there are version issues to be concerned with which I believe is the genesis for nars to start with but assume I need the same version, too? What't the general best practice there?
Also, now that I was able to run my processor, I have a question about logging. I see that the processors use getLogger() to get a logger. But is see in other places a more traditional use of LoggerFactory.getLogger(). What is the best approach to logging from helper classes that I use in my processor that are not inner classes of the processor class by defined outside in separate class files because I intend to reuse them across multiple processor types? I need to debug an error that I am seeing in one of those helper classes and need to add some logging. Mark On Thu, Nov 19, 2015 at 8:23 PM, Bryan Bende <bbe...@gmail.com> wrote: > Hi Mark, > > Glad to hear you were able to get started building processors, and glad > that blog post helped! > > I pulled down your code and built and deployed it. It looks like the issue > is that your processors pom has a dependency on: > <dependency> > <groupId>org.apache.nifi</groupId> > <artifactId>nifi-standard-processors</artifactId> > <version>0.4.0-SNAPSHOT</version> > </dependency> > > Which means your NAR ends up having the standard processors jar in it, but > they are also deployed in nifi-standard-nar which causes some problems. You > can see the jar is there by looking > in > work/nar/extensions/nifi-bigdata-nar-1.0.nar-unpacked/META-INF/bundled-dependencies/. > > I removed that dependency from the pom and it looked like the only > compilation errors were on some missing json related libraries (jackson and > json path). I added these to your processor pom and it seems to deploy now: > > <dependency> > <groupId>com.jayway.jsonpath</groupId> > <artifactId>json-path</artifactId> > <version>2.0.0</version> > </dependency> > <dependency> > <groupId>org.codehaus.jackson</groupId> > <artifactId>jackson-mapper-asl</artifactId> > <version>1.9.13</version> > </dependency> > > Hope that helps. Let us know if you have any other questions! > > -Bryan > > > On Thu, Nov 19, 2015 at 7:53 PM, Mark Petronic <markpetro...@gmail.com> > wrote: > > > Well, I finally built my first processor. Was a nice experience. Nice > APIs! > > This was my first work with Maven and Nifi so, if things look > > wrong/strange, please go easy on me. :) The issue is when I copy the NAR > > file in the lib directory and restart Nifi, it does not start up. I tried > > removing the work directory for a clean start, no joy. If I remove my > NAR, > > works fine. Wondering if one of you experts would not mind helping me > over > > this hump because I have no clue what is happening based on the error > > message in the log. Seems like some other processor, DetectDuplicate, is > > failing to startup when mine is in there?? I pasted the startup log > traces > > here: http://pastebin.com/raw.php?i=UzraAE53. My processor code is here: > > https://bitbucket.org/mpetronic/nificustomprocessors. I would be very > > grateful for any guidance. It seems like a pretty simple processor so I > was > > surprised this happened. The code is commented so hope that helps you > > easily understand what is going on there. Oh, I started from this very > > helpful post (thanks Bryan): > > > > > http://bryanbende.com/development/2015/02/04/custom-processors-for-apache-nifi/ > > . > > I am running a build of Nifi from the GitHub mirror, > > commit 90f6830003b76204e25dec9fafec2488c8bda550. > > > > Thanks, > > Mark > > >