I haven't fully read this thread, but there is already a line in
nifi's bootstrap.conf that you can uncomment:

# Enable Remote Debugging
#java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

Change the port if desired, and then create a Remote Debug
configuration in IntelliJ for that port.

This will debug the main application, not bootstrap.

On Tue, Oct 27, 2020 at 12:08 PM Darren Govoni <dar...@ontrenet.com> wrote:
>
> Hello,
>    So i was able to get intelliJ to debug nifi but only inside the bootstrap 
> process. It looks like nifi spawns a new process and that process does not 
> run the debug options.
>
> Is there a way to instruct nifi to enable debug port on its main process? 
> That will have the actual app code i need to trace.
>
> Thanks for any tips. Much appreciated!
> Darren
>
> Sent from my Verizon, Samsung Galaxy smartphone
> Get Outlook for Android
>
> ________________________________
> From: Mike Thomsen <mikerthom...@gmail.com>
> Sent: Monday, October 26, 2020 10:15:33 PM
> To: users@nifi.apache.org <users@nifi.apache.org>
> Subject: Re: Run Nifi in IntelliJ to debug?
>
> Are you using a binary derived from the source code in your IDE? Like
> a 1.12.1 binary and the source code from the release?
>
> On Mon, Oct 26, 2020 at 7:47 PM Russell Bateman <r...@windofkeltia.com> wrote:
> >
> > Hmmm... It's rare that I debug NiFi code. And it's also rare that I debug 
> > my own in that context since the NiFi test runner allows me to fend off 
> > most surprises via my JUnit tests.
> >
> > I think back in 2016, I was debugging a start-up problem involving NiFi 
> > start-up and incompatibility with the Java Flight Recorder. As I recall, I 
> > downloaded the relevant NiFi code sources matching the version of NiFi I 
> > was debugging remotely. I remember ultimately making a slight (and only 
> > temporary) change to NiFi start-up that fixed the problem. At that point I 
> > must have been building my own copy to have seen it fixed.. It had to do 
> > with the order in which NiFi was getting command-line arguments making it 
> > so the JFR wasn't running. I'd have to dig back to figure out what I was 
> > doing, but it's probably not too relevant to what you need to do.
> >
> > What do you need to see in this?
> >
> > Russ
> >
> > On 10/26/20 5:38 PM, Darren Govoni wrote:
> >
> > Correct. Primarily the nifi-web-api module and AccessResource class. For 
> > starters.
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> > ________________________________
> > From: Russell Bateman <r...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 7:37:13 PM
> > To: Darren Govoni <dar...@ontrenet.com>; users@nifi.apache.org 
> > <users@nifi.apache.org>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > This is just Apache NiFi code out of NARs you want to step through or is it 
> > yours? You haven't stripped debug information or anything, right?
> >
> > Russ
> >
> > On 10/26/20 5:30 PM, Darren Govoni wrote:
> >
> > Kevin/Russel
> >
> > Thanks for the info. I did set things up this way.
> >
> > IntelliJ does connect to the nifi jvm and nifi runs and works but intellij 
> > isnt breaking on code it should.
> >
> > I did set the module where the code/classes are located (in the remote 
> > connection dialog) and i see the exception im tracking print on the console 
> > output but intellij never breaks.
> >
> > Is there an extra step needed? Generate sources?
> >
> > For future it would be nice if there was a maven goal for debug.
> >
> > Much appreciated!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> > ________________________________
> > From: Russell Bateman <r...@windofkeltia.com>
> > Sent: Monday, October 26, 2020 4:09:50 PM
> > To: users@nifi.apache.org <users@nifi.apache.org>; Darren Govoni 
> > <dar...@ontrenet.com>
> > Subject: Re: Run Nifi in IntelliJ to debug?
> >
> > Darren,
> >
> > I was out this morning and didn't see your plea until I got in just now. 
> > Here's a step by step I wrote up for both IntelliJ IDEA and Eclipse (I'm 
> > more an IntelliJ guy). It also covers using an IP tunnel.
> >
> > https://www.javahotchocolate.com/notes/nifi.html#20160323
> >
> > On 10/26/20 9:52 AM, Darren Govoni wrote:
> >
> > Hi
> >    Is it possible to run Nifi from inside IntelliJ with debugging such that 
> > I can hit the app from my browser and trigger breakpoints?
> >
> > If anyone has done this can you please share any info?
> >
> > Thanks in advance!
> > Darren
> >
> > Sent from my Verizon, Samsung Galaxy smartphone
> > Get Outlook for Android
> >
> >
> >
> >

Reply via email to